public class

BasicMenuUI

extends BasicMenuItemUI
java.lang.Object
   ↳ javax.swing.plaf.ComponentUI
     ↳ javax.swing.plaf.ButtonUI
       ↳ javax.swing.plaf.MenuItemUI
         ↳ javax.swing.plaf.basic.BasicMenuItemUI
           ↳ javax.swing.plaf.basic.BasicMenuUI
Known Direct Subclasses

Class Overview

A default L&F implementation of MenuUI. This implementation is a "combined" view/controller.

Summary

Nested Classes
class BasicMenuUI.ChangeHandler As of Java 2 platform 1.4, this previously undocumented class is now obsolete. 
class BasicMenuUI.MouseInputHandler Instantiated and used by a menu item to handle the current menu selection from mouse events. 
Fields
protected ChangeListener changeListener
protected MenuListener menuListener
[Expand]
Inherited Fields
From class javax.swing.plaf.basic.BasicMenuItemUI
Public Constructors
BasicMenuUI()
Public Methods
static ComponentUI createUI(JComponent x)
Dimension getMaximumSize(JComponent c)
Returns the specified component's maximum size appropriate for the look and feel.
Protected Methods
ChangeListener createChangeListener(JComponent c)
MenuDragMouseListener createMenuDragMouseListener(JComponent c)
MenuKeyListener createMenuKeyListener(JComponent c)
MenuListener createMenuListener(JComponent c)
MouseInputListener createMouseInputListener(JComponent c)
PropertyChangeListener createPropertyChangeListener(JComponent c)
Creates a PropertyChangeListener which will be added to the menu item.
String getPropertyPrefix()
void installDefaults()
void installKeyboardActions()
void installListeners()
void setupPostTimer(JMenu menu)
void uninstallDefaults()
void uninstallKeyboardActions()
void uninstallListeners()
[Expand]
Inherited Methods
From class javax.swing.plaf.basic.BasicMenuItemUI
From class javax.swing.plaf.ComponentUI
From class java.lang.Object

Fields

protected ChangeListener changeListener

protected MenuListener menuListener

Public Constructors

public BasicMenuUI ()

Public Methods

public static ComponentUI createUI (JComponent x)

public Dimension getMaximumSize (JComponent c)

Returns the specified component's maximum size appropriate for the look and feel. If null is returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

Parameters
c the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
Returns
  • a Dimension object or null

Protected Methods

protected ChangeListener createChangeListener (JComponent c)

protected MenuDragMouseListener createMenuDragMouseListener (JComponent c)

protected MenuKeyListener createMenuKeyListener (JComponent c)

protected MenuListener createMenuListener (JComponent c)

protected MouseInputListener createMouseInputListener (JComponent c)

protected PropertyChangeListener createPropertyChangeListener (JComponent c)

Creates a PropertyChangeListener which will be added to the menu item. If this method returns null then it will not be added to the menu item.

Returns
  • an instance of a PropertyChangeListener or null

protected String getPropertyPrefix ()

protected void installDefaults ()

protected void installKeyboardActions ()

protected void installListeners ()

protected void setupPostTimer (JMenu menu)

protected void uninstallDefaults ()

protected void uninstallKeyboardActions ()

protected void uninstallListeners ()