javax.swing.plaf.basic

Class BasicPopupMenuUI

public class BasicPopupMenuUI extends PopupMenuUI

UI Delegate for JPopupMenu
Field Summary
protected JPopupMenupopupMenu
Constructor Summary
BasicPopupMenuUI()
Creates a new BasicPopupMenuUI object.
Method Summary
static ComponentUIcreateUI(JComponent x)
Factory method to create a BasicPopupMenuUI for the given {@link JComponent}, which should be a {@link JMenuItem}.
DimensiongetMaximumSize(JComponent c)
This method returns the minimum size of the JPopupMenu.
DimensiongetMinimumSize(JComponent c)
This method returns the minimum size of the JPopupMenu.
DimensiongetPreferredSize(JComponent c)
This method returns the preferred size of the JPopupMenu.
voidinstallDefaults()
This method installs the defaults that are defined in the Basic look and feel for this {@link JPopupMenu}.
protected voidinstallKeyboardActions()
This method installs the keyboard actions for this {@link JPopupMenu}.
protected voidinstallListeners()
This method installs the listeners for the {@link JMenuItem}.
voidinstallUI(JComponent c)
Installs and initializes all fields for this UI delegate.
booleanisPopupTrigger(MouseEvent e)
Return true if given mouse event is a platform popup trigger, and false otherwise
protected voiduninstallDefaults()
This method uninstalls the defaults and sets any objects created during install to null
protected voiduninstallKeyboardActions()
Uninstalls any keyboard actions.
protected voiduninstallListeners()
Unregisters all the listeners that this UI delegate was using.
voiduninstallUI(JComponent c)
Performs the opposite of installUI.

Field Detail

popupMenu

protected JPopupMenu popupMenu

Constructor Detail

BasicPopupMenuUI

public BasicPopupMenuUI()
Creates a new BasicPopupMenuUI object.

Method Detail

createUI

public static ComponentUI createUI(JComponent x)
Factory method to create a BasicPopupMenuUI for the given {@link JComponent}, which should be a {@link JMenuItem}.

Parameters: x The {@link JComponent} a UI is being created for.

Returns: A BasicPopupMenuUI for the {@link JComponent}.

getMaximumSize

public Dimension getMaximumSize(JComponent c)
This method returns the minimum size of the JPopupMenu.

Parameters: c The JComponent to find a size for.

Returns: The minimum size.

getMinimumSize

public Dimension getMinimumSize(JComponent c)
This method returns the minimum size of the JPopupMenu.

Parameters: c The JComponent to find a size for.

Returns: The minimum size.

getPreferredSize

public Dimension getPreferredSize(JComponent c)
This method returns the preferred size of the JPopupMenu.

Parameters: c The JComponent to find a size for.

Returns: The preferred size.

installDefaults

public void installDefaults()
This method installs the defaults that are defined in the Basic look and feel for this {@link JPopupMenu}.

installKeyboardActions

protected void installKeyboardActions()
This method installs the keyboard actions for this {@link JPopupMenu}.

installListeners

protected void installListeners()
This method installs the listeners for the {@link JMenuItem}.

installUI

public void installUI(JComponent c)
Installs and initializes all fields for this UI delegate. Any properties of the UI that need to be initialized and/or set to defaults will be done now. It will also install any listeners necessary.

Parameters: c The {@link JComponent} that is having this UI installed.

isPopupTrigger

public boolean isPopupTrigger(MouseEvent e)
Return true if given mouse event is a platform popup trigger, and false otherwise

Parameters: e MouseEvent that is to be checked for popup trigger event

Returns: true if given mouse event is a platform popup trigger, and false otherwise

uninstallDefaults

protected void uninstallDefaults()
This method uninstalls the defaults and sets any objects created during install to null

uninstallKeyboardActions

protected void uninstallKeyboardActions()
Uninstalls any keyboard actions.

uninstallListeners

protected void uninstallListeners()
Unregisters all the listeners that this UI delegate was using.

uninstallUI

public void uninstallUI(JComponent c)
Performs the opposite of installUI. Any properties or resources that need to be cleaned up will be done now. It will also uninstall any listeners it has. In addition, any properties of this UI will be nulled.

Parameters: c The {@link JComponent} that is having this UI uninstalled.