public abstract class PopupMenuUI extends ComponentUI
JPopupMenu
.JPopupMenu
Constructor and Description |
---|
PopupMenuUI()
Constructs a new
PopupMenuUI . |
Modifier and Type | Method and Description |
---|---|
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.
|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
public PopupMenuUI()
PopupMenuUI
.public boolean isPopupTrigger(MouseEvent event)
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.
event
- the event to check.true
if the event triggers a popup menu;
false
otherwise.public Popup getPopup(JPopupMenu popup, int x, int y)
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.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.Popup
for showing and hiding
the menu.