javax.swing
Class PopupFactory.MediumWeightPopup

java.lang.Object
  extended byjavax.swing.Popup
      extended byjavax.swing.PopupFactory.ContainerPopup
          extended byjavax.swing.PopupFactory.MediumWeightPopup
Enclosing class:
PopupFactory

private static class PopupFactory.MediumWeightPopup
extends PopupFactory.ContainerPopup

Popup implementation that uses a Panel as the popup.


Nested Class Summary
 
Nested classes inherited from class javax.swing.Popup
Popup.DefaultFrame, Popup.HeavyWeightWindow
 
Field Summary
private static Object mediumWeightPopupCacheKey
           
(package private)  Component owner
          Component we are to be added to.
private  JRootPane rootPane
          Child of the panel.
(package private)  int x
          Desired x location.
(package private)  int y
          Desired y location.
 
Fields inherited from class javax.swing.Popup
 
Constructor Summary
private PopupFactory.MediumWeightPopup()
           
 
Method Summary
(package private)  Component createComponent(Component owner)
          Creates the Component to use as the parent of the Popup.
(package private)  boolean fitsOnScreen()
          Returns true if the Popup can fit on the screen.
(package private) static Popup getMediumWeightPopup(Component owner, Component contents, int ownerX, int ownerY)
          Returns a medium weight Popup implementation.
private static List getMediumWeightPopupCache()
          Returns the cache to use for medium weight popups.
private static PopupFactory.MediumWeightPopup getRecycledMediumWeightPopup()
          Returns a previously used MediumWeightPopup, or null if none of the popups have been recycled.
 void hide()
          Hides and disposes of the Popup.
(package private)  boolean overlappedByOwnedWindow()
           
 void pack()
          Causes the Popup to be sized to fit the preferred size of the Component it contains.
private static void recycleMediumWeightPopup(PopupFactory.MediumWeightPopup popup)
          Recycles the MediumWeightPopup popup.
(package private)  void reset(Component owner, Component contents, int ownerX, int ownerY)
          Resets the Popup to an initial state.
 void show()
          Makes the Popup visible.
 
Methods inherited from class javax.swing.Popup
dispose, getComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mediumWeightPopupCacheKey

private static final Object mediumWeightPopupCacheKey

rootPane

private JRootPane rootPane
Child of the panel. The contents are added to this.


owner

Component owner
Component we are to be added to.


x

int x
Desired x location.


y

int y
Desired y location.

Constructor Detail

PopupFactory.MediumWeightPopup

private PopupFactory.MediumWeightPopup()
Method Detail

getMediumWeightPopup

static Popup getMediumWeightPopup(Component owner,
                                  Component contents,
                                  int ownerX,
                                  int ownerY)
Returns a medium weight Popup implementation. If the Popup needs more space that in available in owner, this will return null.


getMediumWeightPopupCache

private static List getMediumWeightPopupCache()
Returns the cache to use for medium weight popups.


recycleMediumWeightPopup

private static void recycleMediumWeightPopup(PopupFactory.MediumWeightPopup popup)
Recycles the MediumWeightPopup popup.


getRecycledMediumWeightPopup

private static PopupFactory.MediumWeightPopup getRecycledMediumWeightPopup()
Returns a previously used MediumWeightPopup, or null if none of the popups have been recycled.


hide

public void hide()
Description copied from class: Popup
Hides and disposes of the Popup. Once a Popup has been disposed you should no longer invoke methods on it. A disposed Popup may be reclaimed and later used based on the PopupFactory. As such, if you invoke methods on a disposed Popup, indeterminate behavior will result.

Overrides:
hide in class PopupFactory.ContainerPopup

show

public void show()
Description copied from class: Popup
Makes the Popup visible. If the Popup is currently visible, this has no effect.

Overrides:
show in class Popup

createComponent

Component createComponent(Component owner)
Description copied from class: Popup
Creates the Component to use as the parent of the Popup. The default implementation creates a Window, subclasses should override.

Overrides:
createComponent in class Popup

reset

void reset(Component owner,
           Component contents,
           int ownerX,
           int ownerY)
Resets the Popup to an initial state.

Overrides:
reset in class PopupFactory.ContainerPopup

pack

public void pack()
Description copied from class: Popup
Causes the Popup to be sized to fit the preferred size of the Component it contains.

Overrides:
pack in class Popup

overlappedByOwnedWindow

boolean overlappedByOwnedWindow()

fitsOnScreen

boolean fitsOnScreen()
Returns true if the Popup can fit on the screen.