javax.swing.plaf.basic
Class BasicMenuUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ButtonUI
          extended by javax.swing.plaf.MenuItemUI
              extended by javax.swing.plaf.basic.BasicMenuItemUI
                  extended by javax.swing.plaf.basic.BasicMenuUI

public class BasicMenuUI
extends BasicMenuItemUI

UI Delegate for JMenu


Nested Class Summary
 class BasicMenuUI.ChangeHandler
          Obsolete as of JDK1.4.
protected  class BasicMenuUI.MouseInputHandler
          This class is used by menus to handle mouse events occuring in the menu.
 
Field Summary
protected  ChangeListener changeListener
           
protected  MenuListener menuListener
           
protected  PropertyChangeListener propertyChangeListener
           
 
Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI
acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, selectionBackground, selectionForeground
 
Constructor Summary
BasicMenuUI()
          Creates a new BasicMenuUI object.
 
Method Summary
protected  ChangeListener createChangeListener(JComponent c)
          This method creates a new ChangeListener.
protected  MenuDragMouseListener createMenuDragMouseListener(JComponent c)
          This method creates new MenuDragMouseListener to listen to mouse dragged events occuring in the Menu
protected  MenuKeyListener createMenuKeyListener(JComponent c)
          This method creates new MenuDragKeyListener to listen to key events
protected  MenuListener createMenuListener(JComponent c)
          This method creates new MenuListener to listen to menu events occuring in the Menu
protected  MouseInputListener createMouseInputListener(JComponent c)
          This method creates new MouseInputListener to listen to mouse input events occuring in the Menu
protected  PropertyChangeListener createPropertyChangeListener(JComponent c)
          This method creates newPropertyChangeListener to listen to property changes occuring in the Menu
static ComponentUI createUI(JComponent c)
          This method creates a new BasicMenuUI.
 Dimension getMaximumSize(JComponent c)
          Get the component's maximum size.
protected  String getPropertyPrefix()
          Returns the prefix for entries in the UIDefaults table.
protected  void installDefaults()
          Initializes any default properties that this UI has from the defaults for the Basic look and feel.
protected  void installKeyboardActions()
          Installs any keyboard actions.
protected  void installListeners()
          Creates and registers all the listeners for this UI delegate.
protected  void setupPostTimer(JMenu menu)
           
protected  void uninstallDefaults()
          This method uninstalls the defaults and sets any objects created during install to null
protected  void uninstallKeyboardActions()
          Uninstalls any keyboard actions.
protected  void uninstallListeners()
          Unregisters all the listeners that this UI delegate was using.
 
Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI
doClick, getMinimumSize, getPath, getPreferredMenuItemSize, getPreferredSize, installComponents, installUI, paint, paintBackground, paintMenuItem, paintText, uninstallComponents, uninstallUI, update
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

Overrides:
createMenuDragMouseListener in class BasicMenuItemUI
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

Overrides:
createMenuKeyListener in class BasicMenuItemUI
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

Overrides:
createMouseInputListener in class BasicMenuItemUI
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.

Overrides:
getMaximumSize in class BasicMenuItemUI
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 UIDefaults table.

Overrides:
getPropertyPrefix in class BasicMenuItemUI
Returns:
"Menu"

installDefaults

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

Overrides:
installDefaults in class BasicMenuItemUI

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.

Overrides:
installKeyboardActions in class BasicMenuItemUI

installListeners

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

Overrides:
installListeners in class BasicMenuItemUI

setupPostTimer

protected void setupPostTimer(JMenu menu)

uninstallDefaults

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

Overrides:
uninstallDefaults in class BasicMenuItemUI

uninstallKeyboardActions

protected void uninstallKeyboardActions()
Uninstalls any keyboard actions. The list of keys used are listed in Basic look and feel's defaults.

Overrides:
uninstallKeyboardActions in class BasicMenuItemUI

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.

Overrides:
uninstallListeners in class BasicMenuItemUI