PopupFactory, as the name implies, is used to obtain
instances of Popups. Popups are used to
display a Component above all other Components
in a particular containment hierarchy. The general contract is that
once you have obtained a Popup from a
PopupFactory, you must invoke hide on the
Popup. The typical usage is:
PopupFactory factory = PopupFactory.getSharedInstance(); Popup popup = factory.getPopup(owner, contents, x, y); popup.show(); ... popup.hide();
Popup
| Modifier and Type | Class and Description |
|---|---|
| private static class | PopupFactory.
ContainerPopup consolidates the common code used in the light/medium
weight implementations of |
| private static class | PopupFactory.
Popup implementation that is used in headless environment. |
| private static class | PopupFactory.
Popup implementation that uses a Window as the popup. |
| private static class | PopupFactory.
Popup implementation that uses a JPanel as the popup. |
| private static class | PopupFactory.
Popup implementation that uses a Panel as the popup. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | |
| pack-priv static final int | LIGHT_WEIGHT_POPUP
Key used to indicate a light weight popup should be used. |
| private static final int | MAX_CACHE_SIZE
Max number of items to store in any one particular cache. |
| pack-priv static final int | MEDIUM_WEIGHT_POPUP
Key used to indicate a medium weight Popup should be used. |
| private int | popupType
Default type of Popup to create. |
| pack-priv static PopupFactory |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Popup | getHeadlessPopup(Component owner, Component contents, int ownerX, int ownerY)
Creates a headless popup |
| private Popup | getHeavyWeightPopup(Component owner, Component contents, int ownerX, int ownerY)
Creates a heavy weight popup. |
| private Popup | getLightWeightPopup(Component owner, Component contents, int ownerX, int ownerY)
Creates a light weight popup. |
| private Popup | getMediumWeightPopup(Component owner, Component contents, int ownerX, int ownerY)
Creates a medium weight popup. |
| public Popup | |
| protected Popup | Returns: Popup containing ContentsComponent mouse coordinates are relative to, may be null owner, Component Contents of the Popup contents, int Initial x screen coordinate x, int Initial y screen coordinate y, boolean true if Popup should be heavy weight,
otherwise popup type will be selected by popup factory. isHeavyWeightPopup)Creates a |
| private Popup | |
| pack-priv int | |
| private int | getPopupType(Component owner, Component contents, int ownerX, int ownerY)
Returns the popup type to use for the specified parameters. |
| public static PopupFactory | Returns: Shared PopupFactoryReturns the shared |
| private boolean | |
| pack-priv void | |
| public static void | setSharedInstance(PopupFactory
Shared PopupFactory factory)Sets the |
| HEAVY_WEIGHT_POPUP | back to summary |
|---|---|
| pack-priv static final int HEAVY_WEIGHT_POPUP | |
| LIGHT_WEIGHT_POPUP | back to summary |
|---|---|
| pack-priv static final int LIGHT_WEIGHT_POPUP Key used to indicate a light weight popup should be used. | |
| MAX_CACHE_SIZE | back to summary |
|---|---|
| private static final int MAX_CACHE_SIZE Max number of items to store in any one particular cache. | |
| MEDIUM_WEIGHT_POPUP | back to summary |
|---|---|
| pack-priv static final int MEDIUM_WEIGHT_POPUP Key used to indicate a medium weight Popup should be used. | |
| popupType | back to summary |
|---|---|
| private int popupType Default type of Popup to create. | |
| sharedFactory | back to summary |
|---|---|
| pack-priv static PopupFactory sharedFactory | |
| PopupFactory | back to summary |
|---|---|
| public PopupFactory() Constructs a | |
| getHeadlessPopup | back to summary |
|---|---|
| private Popup getHeadlessPopup(Component owner, Component contents, int ownerX, int ownerY) Creates a headless popup | |
| getHeavyWeightPopup | back to summary |
|---|---|
| private Popup getHeavyWeightPopup(Component owner, Component contents, int ownerX, int ownerY) Creates a heavy weight popup. | |
| getLightWeightPopup | back to summary |
|---|---|
| private Popup getLightWeightPopup(Component owner, Component contents, int ownerX, int ownerY) Creates a light weight popup. | |
| getMediumWeightPopup | back to summary |
|---|---|
| private Popup getMediumWeightPopup(Component owner, Component contents, int ownerX, int ownerY) Creates a medium weight popup. | |
| getPopup | back to summary |
|---|---|
| public Popup getPopup(Component owner, Component contents, int x, int y) throws IllegalArgumentException Creates a
| |
| getPopup | back to summary |
|---|---|
| protected Popup getPopup(Component owner, Component contents, int x, int y, boolean isHeavyWeightPopup) throws IllegalArgumentException Creates a
| |
| getPopup | back to summary |
|---|---|
| private Popup getPopup(Component owner, Component contents, int ownerX, int ownerY, int popupType) Obtains the appropriate | |
| getPopupType | back to summary |
|---|---|
| pack-priv int getPopupType() Returns the preferred type of Popup to create. | |
| getPopupType | back to summary |
|---|---|
| private int getPopupType(Component owner, Component contents, int ownerX, int ownerY) Returns the popup type to use for the specified parameters. | |
| getSharedInstance | back to summary |
|---|---|
| public static PopupFactory getSharedInstance() Returns the shared
| |
| invokerInHeavyWeightPopup | back to summary |
|---|---|
| private boolean invokerInHeavyWeightPopup(Component i) Returns true if the Component | |
| setPopupType | back to summary |
|---|---|
| pack-priv void setPopupType(int type) Provides a hint as to the type of | |
| setSharedInstance | back to summary |
|---|---|
| public static void setSharedInstance(PopupFactory factory) Sets the
| |
Popup.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Component | owner
Component we are to be added to. |
| pack-priv int | x
Desired x location. |
| pack-priv int | y
Desired y location. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| pack-priv Rectangle | |
| public void | |
| pack-priv boolean | |
| public void | pack()
Overrides javax. Causes the |
| pack-priv void | reset(Component owner, Component contents, int ownerX, int ownerY)
Overrides javax. Resets the |
| owner | back to summary |
|---|---|
| pack-priv Component owner Component we are to be added to. | |
| x | back to summary |
|---|---|
| pack-priv int x Desired x location. | |
| y | back to summary |
|---|---|
| pack-priv int y Desired y location. | |
| ContainerPopup | back to summary |
|---|---|
| private ContainerPopup() | |
| fitsOnScreen | back to summary |
|---|---|
| pack-priv boolean fitsOnScreen() Returns true if popup can fit the screen and the owner's top parent. It determines can popup be lightweight or mediumweight. | |
| getContainerPopupArea | back to summary |
|---|---|
| pack-priv Rectangle getContainerPopupArea(GraphicsConfiguration gc) | |
| hide | back to summary |
|---|---|
| public void hide() Overrides javax. Doc from javax. Hides and disposes of the | |
| overlappedByOwnedWindow | back to summary |
|---|---|
| pack-priv boolean overlappedByOwnedWindow() | |
| pack | back to summary |
|---|---|
| public void pack() Overrides javax. Doc from javax. Causes the | |
| reset | back to summary |
|---|---|
| pack-priv void reset(Component owner, Component contents, int ownerX, int ownerY) Overrides javax. Doc from javax. Resets the | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Component | createComponent(Component owner)
Overrides javax. Creates the Component to use as the parent of the |
| pack-priv static Popup | |
| public void | |
| public void |
| HeadlessPopup | back to summary |
|---|---|
| private HeadlessPopup() | |
| createComponent | back to summary |
|---|---|
| pack-priv Component createComponent(Component owner) Overrides javax. Doc from javax. Creates the Component to use as the parent of the | |
| getHeadlessPopup | back to summary |
|---|---|
| pack-priv static Popup getHeadlessPopup(Component owner, Component contents, int ownerX, int ownerY) | |
| hide | back to summary |
|---|---|
| public void hide() Overrides javax. Doc from javax. Hides and disposes of the | |
| show | back to summary |
|---|---|
| public void show() Overrides javax. Doc from javax. Makes the | |
| Modifier and Type | Field and Description |
|---|---|
| private static Map | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | dispose()
Overrides javax. As we recycle the |
| pack-priv static Popup | getHeavyWeightPopup(Component owner, Component contents, int ownerX, int ownerY)
Returns either a new or recycled |
| private static Map | |
| private static PopupFactory. | getRecycledHeavyWeightPopup(Window w)
Returns a previously disposed heavy weight |
| public void | |
| private static void | recycleHeavyWeightPopup(PopupFactory.
Recycles the passed in |
| pack-priv void |
| cache | back to summary |
|---|---|
| private static Map<Window, List<PopupFactory. | |
| isCacheEnabled | back to summary |
|---|---|
| private volatile boolean isCacheEnabled | |
| HeavyWeightPopup | back to summary |
|---|---|
| private HeavyWeightPopup() | |
| _dispose | back to summary |
|---|---|
| pack-priv void _dispose() | |
| dispose | back to summary |
|---|---|
| pack-priv void dispose() Overrides javax. As we recycle the | |
| getHeavyWeightPopup | back to summary |
|---|---|
| pack-priv static Popup getHeavyWeightPopup(Component owner, Component contents, int ownerX, int ownerY) Returns either a new or recycled | |
| getHeavyWeightPopupCache | back to summary |
|---|---|
| private static Map Returns the cache to use for heavy weight popups. Maps from
| |
| getRecycledHeavyWeightPopup | back to summary |
|---|---|
| private static PopupFactory. Returns a previously disposed heavy weight | |
| hide | back to summary |
|---|---|
| public void hide() Overrides javax. Doc from javax. Hides and disposes of the | |
| recycleHeavyWeightPopup | back to summary |
|---|---|
| private static void recycleHeavyWeightPopup(PopupFactory. Recycles the passed in | |
| setCacheEnabled | back to summary |
|---|---|
| pack-priv void setCacheEnabled(boolean enable) Enables or disables cache for current object. | |
| Modifier and Type | Field and Description |
|---|---|
| private static List | |
| private static final Object |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Component | createComponent(Component owner)
Overrides javax. Creates the Component to use as the parent of the |
| pack-priv static Popup | getLightWeightPopup(Component owner, Component contents, int ownerX, int ownerY)
Returns a light weight |
| private static List | |
| private static PopupFactory. | getRecycledLightWeightPopup()
Returns a previously used |
| public void | |
| private static void | |
| pack-priv void | reset(Component owner, Component contents, int ownerX, int ownerY)
Overrides javax. Resets the |
| public void |
| cache | back to summary |
|---|---|
| private static List<PopupFactory. | |
| lightWeightPopupCacheKey | back to summary |
|---|---|
| private static final Object lightWeightPopupCacheKey | |
| LightWeightPopup | back to summary |
|---|---|
| private LightWeightPopup() | |
| createComponent | back to summary |
|---|---|
| pack-priv Component createComponent(Component owner) Overrides javax. Doc from javax. Creates the Component to use as the parent of the | |
| getLightWeightPopup | back to summary |
|---|---|
| pack-priv static Popup getLightWeightPopup(Component owner, Component contents, int ownerX, int ownerY) Returns a light weight | |
| getLightWeightPopupCache | back to summary |
|---|---|
| private static List Returns the cache to use for heavy weight popups. | |
| getRecycledLightWeightPopup | back to summary |
|---|---|
| private static PopupFactory. Returns a previously used | |
| hide | back to summary |
|---|---|
| public void hide() Overrides javax. Doc from javax. Hides and disposes of the | |
| recycleLightWeightPopup | back to summary |
|---|---|
| private static void recycleLightWeightPopup(PopupFactory. Recycles the LightWeightPopup | |
| reset | back to summary |
|---|---|
| pack-priv void reset(Component owner, Component contents, int ownerX, int ownerY) Overrides javax. Resets the | |
| show | back to summary |
|---|---|
| public void show() Overrides javax. Doc from javax. Makes the | |
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static List | |
| private JRootPane | rootPane
Child of the panel. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Component | createComponent(Component owner)
Overrides javax. Creates the Component to use as the parent of the |
| pack-priv static Popup | getMediumWeightPopup(Component owner, Component contents, int ownerX, int ownerY)
Returns a medium weight |
| private static List | |
| private static PopupFactory. | getRecycledMediumWeightPopup()
Returns a previously used |
| public void | |
| private static void | |
| pack-priv void | reset(Component owner, Component contents, int ownerX, int ownerY)
Overrides javax. Resets the |
| public void |
| cache | back to summary |
|---|---|
| private static List<PopupFactory. | |
| rootPane | back to summary |
|---|---|
| private JRootPane rootPane Child of the panel. The contents are added to this. | |
| MediumWeightPopup | back to summary |
|---|---|
| private MediumWeightPopup() | |
| createComponent | back to summary |
|---|---|
| pack-priv Component createComponent(Component owner) Overrides javax. Doc from javax. Creates the Component to use as the parent of the | |
| getMediumWeightPopup | back to summary |
|---|---|
| pack-priv static Popup getMediumWeightPopup(Component owner, Component contents, int ownerX, int ownerY) Returns a medium weight | |
| getMediumWeightPopupCache | back to summary |
|---|---|
| private static List Returns the cache to use for medium weight popups. | |
| getRecycledMediumWeightPopup | back to summary |
|---|---|
| private static PopupFactory. Returns a previously used | |
| hide | back to summary |
|---|---|
| public void hide() Overrides javax. Doc from javax. Hides and disposes of the | |
| recycleMediumWeightPopup | back to summary |
|---|---|
| private static void recycleMediumWeightPopup(PopupFactory. Recycles the MediumWeightPopup | |
| reset | back to summary |
|---|---|
| pack-priv void reset(Component owner, Component contents, int ownerX, int ownerY) Overrides javax. Resets the | |
| show | back to summary |
|---|---|
| public void show() Overrides javax. Doc from javax. Makes the | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| MediumWeightComponent | back to summary |
|---|---|
| pack-priv MediumWeightComponent() | |