Class BasicMenuUI
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
- Direct Known Subclasses:
SynthMenuUI
A default L&F implementation of MenuUI. This implementation
is a "combined" view/controller.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAs of Java 2 platform 1.4, this previously undocumented class is now obsolete.protected classInstantiated and used by a menu item to handle the current menu selection from mouse events. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChangeListenerThe instance ofChangeListener.protected MenuListenerThe instance ofMenuListener.Fields inherited from class BasicMenuItemUI
acceleratorDelimiter, acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, propertyChangeListener, selectionBackground, selectionForeground -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ChangeListenerReturns an instance ofChangeListener.protected MenuDragMouseListenerReturns an instance ofMenuDragMouseListener.protected MenuKeyListenerReturns an instance ofMenuKeyListener.protected MenuListenerReturns an instance ofMenuListener.protected MouseInputListenerReturns an instance ofMouseInputListener.protected PropertyChangeListenerCreates aPropertyChangeListenerwhich will be added to the menu item.static ComponentUIConstructs a new instance ofBasicMenuUI.Returns the specified component's maximum size appropriate for the look and feel.Returns the specified component's minimum size appropriate for the look and feel.protected StringReturns a property prefix.protected voidInstalls default properties.protected voidRegisters keyboard action.protected voidRegisters listeners.protected voidsetupPostTimer(JMenu menu) Sets timer to themenu.protected voidUninstalls default properties.protected voidUnregisters keyboard actions.protected voidUnregisters listeners.Methods inherited from class BasicMenuItemUI
doClick, getPath, getPreferredMenuItemSize, getPreferredSize, installComponents, installUI, paint, paintBackground, paintMenuItem, paintText, uninstallComponents, uninstallUI, updateMethods inherited from class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
-
Field Details
-
changeListener
The instance ofChangeListener.
-
-
Constructor Details
-
BasicMenuUI
public BasicMenuUI()Constructs aBasicMenuUI.
-
-
Method Details
-
createUI
Constructs a new instance ofBasicMenuUI.- Parameters:
x- a component- Returns:
- a new instance of
BasicMenuUI
-
installDefaults
protected void installDefaults()Description copied from class:BasicMenuItemUIInstalls default properties.- Overrides:
installDefaultsin classBasicMenuItemUI
-
getPropertyPrefix
Description copied from class:BasicMenuItemUIReturns a property prefix.- Overrides:
getPropertyPrefixin classBasicMenuItemUI- Returns:
- a property prefix
-
installListeners
protected void installListeners()Description copied from class:BasicMenuItemUIRegisters listeners.- Overrides:
installListenersin classBasicMenuItemUI
-
installKeyboardActions
protected void installKeyboardActions()Description copied from class:BasicMenuItemUIRegisters keyboard action.- Overrides:
installKeyboardActionsin classBasicMenuItemUI
-
uninstallKeyboardActions
protected void uninstallKeyboardActions()Description copied from class:BasicMenuItemUIUnregisters keyboard actions.- Overrides:
uninstallKeyboardActionsin classBasicMenuItemUI
-
createMouseInputListener
Description copied from class:BasicMenuItemUIReturns an instance ofMouseInputListener.- Overrides:
createMouseInputListenerin classBasicMenuItemUI- Parameters:
c- a component- Returns:
- an instance of
MouseInputListener
-
createMenuListener
Returns an instance ofMenuListener.- Parameters:
c- a component- Returns:
- an instance of
MenuListener
-
createChangeListener
Returns an instance ofChangeListener.- Parameters:
c- a component- Returns:
- an instance of
ChangeListener
-
createPropertyChangeListener
Description copied from class:BasicMenuItemUICreates aPropertyChangeListenerwhich will be added to the menu item. If this method returns null then it will not be added to the menu item.- Overrides:
createPropertyChangeListenerin classBasicMenuItemUI- Parameters:
c- a component- Returns:
- an instance of a
PropertyChangeListeneror null
-
uninstallDefaults
protected void uninstallDefaults()Description copied from class:BasicMenuItemUIUninstalls default properties.- Overrides:
uninstallDefaultsin classBasicMenuItemUI
-
uninstallListeners
protected void uninstallListeners()Description copied from class:BasicMenuItemUIUnregisters listeners.- Overrides:
uninstallListenersin classBasicMenuItemUI
-
createMenuDragMouseListener
Description copied from class:BasicMenuItemUIReturns an instance ofMenuDragMouseListener.- Overrides:
createMenuDragMouseListenerin classBasicMenuItemUI- Parameters:
c- a component- Returns:
- an instance of
MenuDragMouseListener
-
createMenuKeyListener
Description copied from class:BasicMenuItemUIReturns an instance ofMenuKeyListener.- Overrides:
createMenuKeyListenerin classBasicMenuItemUI- Parameters:
c- a component- Returns:
- an instance of
MenuKeyListener
-
getMinimumSize
Description copied from class:ComponentUIReturns the specified component's minimum size appropriate for the look and feel. Ifnullis returned, the minimum 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 invokesgetPreferredSizeand returns that value.- Overrides:
getMinimumSizein classBasicMenuItemUI- Parameters:
c- the component whose minimum 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
Dimensionobject ornull - See Also:
-
getMaximumSize
Description copied from class:ComponentUIReturns the specified component's maximum size appropriate for the look and feel. Ifnullis 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 invokesgetPreferredSizeand returns that value.- Overrides:
getMaximumSizein classBasicMenuItemUI- 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
Dimensionobject ornull - See Also:
-
setupPostTimer
Sets timer to themenu.- Parameters:
menu- an instance ofJMenu.
-