javax.swing.plaf

Class PopupMenuUI

public abstract class PopupMenuUI extends ComponentUI

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

See Also:

Constructor Summary
PopupMenuUI()
Constructs a new PopupMenuUI.
Method Summary
PopupgetPopup(JPopupMenu popup, int x, int y)
Creates a Popup for displaying the popup menu.
booleanisPopupTrigger(MouseEvent event)
Tests whether or not a mouse event triggers a popup menu.

Constructor Detail

PopupMenuUI

public PopupMenuUI()
Constructs a new PopupMenuUI.

Method Detail

getPopup

public Popup getPopup(JPopupMenu popup, int x, int y)
Creates a Popup for displaying the popup menu. The default implementation uses the {@link javax.swing.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

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