javax.swing.plaf.basic

Class BasicMenuUI

public class BasicMenuUI extends BasicMenuItemUI

UI Delegate for JMenu
Nested Class Summary
classBasicMenuUI.ChangeHandler
Obsolete as of JDK1.4.
protected classBasicMenuUI.MouseInputHandler
This class is used by menus to handle mouse events occuring in the menu.
Field Summary
protected ChangeListenerchangeListener
protected MenuListenermenuListener
protected PropertyChangeListenerpropertyChangeListener
Constructor Summary
BasicMenuUI()
Creates a new BasicMenuUI object.
Method Summary
protected ChangeListenercreateChangeListener(JComponent c)
This method creates a new ChangeListener.
protected MenuDragMouseListenercreateMenuDragMouseListener(JComponent c)
This method creates new MenuDragMouseListener to listen to mouse dragged events occuring in the Menu
protected MenuKeyListenercreateMenuKeyListener(JComponent c)
This method creates new MenuDragKeyListener to listen to key events
protected MenuListenercreateMenuListener(JComponent c)
This method creates new MenuListener to listen to menu events occuring in the Menu
protected MouseInputListenercreateMouseInputListener(JComponent c)
This method creates new MouseInputListener to listen to mouse input events occuring in the Menu
protected PropertyChangeListenercreatePropertyChangeListener(JComponent c)
This method creates newPropertyChangeListener to listen to property changes occuring in the Menu
static ComponentUIcreateUI(JComponent c)
This method creates a new BasicMenuUI.
DimensiongetMaximumSize(JComponent c)
Get the component's maximum size.
protected StringgetPropertyPrefix()
Returns the prefix for entries in the {@link UIDefaults} table.
protected voidinstallDefaults()
Initializes any default properties that this UI has from the defaults for the Basic look and feel.
protected voidinstallKeyboardActions()
Installs any keyboard actions.
protected voidinstallListeners()
Creates and registers all the listeners for this UI delegate.
protected voidsetupPostTimer(JMenu menu)
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.

Field Detail

changeListener

protected ChangeListener changeListener

menuListener

protected MenuListener menuListener

propertyChangeListener

protected PropertyChangeListener propertyChangeListener

Constructor Detail

BasicMenuUI

public BasicMenuUI()
Creates a new BasicMenuUI object.

Method Detail

createChangeListener

protected ChangeListener createChangeListener(JComponent c)
This method creates a new ChangeListener.

Returns: A new ChangeListener.

createMenuDragMouseListener

protected MenuDragMouseListener createMenuDragMouseListener(JComponent c)
This method creates new MenuDragMouseListener to listen to mouse dragged events occuring in the Menu

Parameters: c the menu to listen to

Returns: The MenuDrageMouseListener

createMenuKeyListener

protected MenuKeyListener createMenuKeyListener(JComponent c)
This method creates new MenuDragKeyListener to listen to key events

Parameters: c the menu to listen to

Returns: The MenuKeyListener

createMenuListener

protected MenuListener createMenuListener(JComponent c)
This method creates new MenuListener to listen to menu events occuring in the Menu

Parameters: c the menu to listen to

Returns: The MenuListener

createMouseInputListener

protected MouseInputListener createMouseInputListener(JComponent c)
This method creates new MouseInputListener to listen to mouse input events occuring in the Menu

Parameters: c the menu to listen to

Returns: The MouseInputListener

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener(JComponent c)
This method creates newPropertyChangeListener to listen to property changes occuring in the Menu

Parameters: c the menu to listen to

Returns: The PropertyChangeListener

createUI

public static ComponentUI createUI(JComponent c)
This method creates a new BasicMenuUI.

Parameters: c The JComponent to create a UI for.

Returns: A new BasicMenuUI.

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Get the component's maximum size.

Parameters: c The JComponent for which to get maximum size

Returns: The maximum size of the component

getPropertyPrefix

protected String getPropertyPrefix()
Returns the prefix for entries in the {@link UIDefaults} table.

Returns: "Menu"

installDefaults

protected void installDefaults()
Initializes any default properties that this UI has from the defaults for the Basic look and feel.

installKeyboardActions

protected void installKeyboardActions()
Installs any keyboard actions. The list of keys that need to be bound are listed in Basic look and feel's defaults.

installListeners

protected void installListeners()
Creates and registers all the listeners for this UI delegate.

setupPostTimer

protected void setupPostTimer(JMenu menu)

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. The list of keys used are listed in Basic look and feel's defaults.

uninstallListeners

protected void uninstallListeners()
Unregisters all the listeners that this UI delegate was using. In addition, it will also null any listeners that it was using.