javax.swing.plaf
Class PopupMenuUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.PopupMenuUI
Direct Known Subclasses:
BasicPopupMenuUI, MultiPopupMenuUI

public abstract class PopupMenuUI
extends ComponentUI

An abstract base class for delegates that implement the pluggable look and feel for a JPopupMenu.

See Also:
JPopupMenu

Constructor Summary
PopupMenuUI()
          Constructs a new PopupMenuUI.
 
Method Summary
 Popup getPopup(JPopupMenu popup, int x, int y)
          Creates a Popup for displaying the popup menu.
 boolean isPopupTrigger(MouseEvent event)
          Tests whether or not a mouse event triggers a popup menu.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PopupMenuUI

public PopupMenuUI()
Constructs a new PopupMenuUI.

Method Detail

isPopupTrigger

public boolean isPopupTrigger(MouseEvent event)
Tests whether or not a mouse event triggers a popup menu.

The default implementation calls event.isPopupTrigger(), which checks for the gesture that is common for the platform on which the application runs. If a look and feel wants to employ non-standard conventions for triggering a popup menu, it can override this method.

Parameters:
event - the event to check.
Returns:
true if the event triggers a popup menu; false otherwise.
Since:
1.3

getPopup

public Popup getPopup(JPopupMenu popup,
                      int x,
                      int y)
Creates a Popup for displaying the popup menu. The default implementation uses the PopupFactory for retrieving a suitable Popup, but subclasses might want to override this method if a LookAndFeel needs special Popups.

Parameters:
popup - the JPopupMenu for whose display a Popup is needed.
x - the horizontal position where the popup will be displayed.
y - the vertical position where the popup will be displayed.
Returns:
a Popup for showing and hiding the menu.
Since:
1.4