Package com.jidesoft.plaf.metal
Class MetalMenuItemUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.MenuItemUI
com.jidesoft.plaf.metal.MetalMenuItemUI
- Direct Known Subclasses:
MetalCheckBoxMenuItemUI,MetalMenuUI
MetalMenuItem implementation
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ThemePainterprotected Fontprotected Colorprotected Colorprotected Iconprotected Iconprotected intprotected Colorprotected MenuDragMouseListenerprotected JMenuItemprotected MenuKeyListenerprotected MouseInputListenerprotected booleanprotected Colorprotected Color -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ActionMapprotected InputMapcreateInputMap(int condition) protected MenuDragMouseListenerprotected MenuKeyListenerprotected MouseInputListenerstatic ComponentUIprotected voidCall this method when a menu item is to be activated.protected ActionMapgetPath()protected DimensiongetPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap) protected Stringprotected intprotected voidinstallComponents(JMenuItem menuItem) protected voidprotected voidprotected voidvoidprotected booleanvoidpaint(Graphics g, JComponent c) protected voidpaintBackground(Graphics g, JMenuItem menuItem, Color bgColor) Draws the background of the menu item.protected voidpaintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) protected voidRenders the text of the current menu item.protected voiduninstallComponents(JMenuItem menuItem) protected voidprotected voidprotected voidvoidvoidupdate(Graphics g, JComponent c) We draw the background in paintMenuItem() so override update (which fills the background of opaque components by default) to just call paint().Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
-
Field Details
-
selectionBackground
-
selectionForeground
-
disabledForeground
-
acceleratorForeground
-
acceleratorSelectionForeground
-
defaultTextIconGap
protected int defaultTextIconGap -
acceleratorFont
-
mouseInputListener
-
arrowIcon
-
checkIcon
-
oldBorderPainted
protected boolean oldBorderPainted -
_painter
-
Constructor Details
-
MetalMenuItemUI
public MetalMenuItemUI()
-
-
Method Details
-
createUI
-
installUI
- Overrides:
installUIin classComponentUI
-
installDefaults
protected void installDefaults() -
installComponents
- Since:
- 1.3
-
getPropertyPrefix
-
installListeners
protected void installListeners() -
installKeyboardActions
protected void installKeyboardActions() -
uninstallUI
- Overrides:
uninstallUIin classComponentUI
-
uninstallDefaults
protected void uninstallDefaults() -
uninstallComponents
- Since:
- 1.3
-
uninstallListeners
protected void uninstallListeners() -
uninstallKeyboardActions
protected void uninstallKeyboardActions() -
createMouseInputListener
-
createMenuDragMouseListener
-
createMenuKeyListener
-
getActionMap
-
createActionMap
-
createInputMap
-
getMinimumSize
- Overrides:
getMinimumSizein classComponentUI
-
getPreferredSize
- Overrides:
getPreferredSizein classComponentUI
-
getMaximumSize
- Overrides:
getMaximumSizein classComponentUI
-
getPreferredMenuItemSize
protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap) -
update
We draw the background in paintMenuItem() so override update (which fills the background of opaque components by default) to just call paint().- Overrides:
updatein classComponentUI
-
paint
- Overrides:
paintin classComponentUI
-
paintMenuItem
-
paintBackground
Draws the background of the menu item.- Parameters:
g- the paint graphicsmenuItem- menu item to be paintedbgColor- selection background color- Since:
- 1.4
-
paintText
Renders the text of the current menu item.- Parameters:
g- graphics contextmenuItem- menu item to rendertextRect- bounding rectangle for rendering the texttext- string to render- Since:
- 1.4
-
getPath
-
doClick
Call this method when a menu item is to be activated. This method handles some of the details of menu item activation such as clearing the selected path and messaging the JMenuItem's doClick() method.- Parameters:
msm- A MenuSelectionManager. The visual feedback and internal bookkeeping tasks are delegated to this MenuSelectionManager. Ifnullis passed as this argument, theMenuSelectionManager.defaultManageris used.- Since:
- 1.4
- See Also:
-
getPainter
-
isDownArrowVisible
-
getRightMargin
protected int getRightMargin()
-