Package com.jidesoft.plaf.vsnet
Class VsnetMenuItemUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.MenuItemUI
com.jidesoft.plaf.vsnet.VsnetMenuItemUI
- Direct Known Subclasses:
MetalRadioButtonMenuItemUI,VsnetCheckBoxMenuItemUI,VsnetMenuUI,VsnetRadioButtonMenuItemUI
MenuItem UI implementation
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Fontprotected Colorprotected static Rectangleprotected Colorprotected Iconprotected static Rectangleprotected Colorprotected Colorprotected Iconprotected static Rectangleprotected intprotected intprotected intprotected Colorprotected static Rectangleprotected MenuDragMouseListenerprotected JMenuItemprotected MenuKeyListenerprotected MouseInputListenerprotected booleanprotected Colorprotected Colorprotected Colorprotected static Rectangleprotected static Rectangleprotected InputMapUsed for accelerator binding, lazily created.protected static Rectangle -
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 ActionMapprotected Iconprotected ThemePaintergetPath()protected DimensiongetPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int textIconGap) protected Stringprotected intprotected voidinstallComponents(JMenuItem menuItem) protected voidprotected voidprotected voidvoidprotected booleanprotected booleanvoidpaint(Graphics g, JComponent c) protected voidpaintBackground(Graphics g, JMenuItem menuItem, Color bgColor) Draws the background of the menu item.protected voidpaintCheckBox(JMenuItem b, Graphics g, Icon checkIcon) protected voidprotected voidpaintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) protected voidMethod which renders 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().protected booleanMethods 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 -
windowInputMap
Used for accelerator binding, lazily created. -
shadowColor
-
defaultAccelEndGap
protected int defaultAccelEndGap -
defaultShadowWidth
protected int defaultShadowWidth -
borderColor
-
backgroundColor
-
_isFloatingIcon
protected boolean _isFloatingIcon -
zeroRect
-
iconRect
-
textRect
-
acceleratorRect
-
checkIconRect
-
arrowIconRect
-
viewRect
-
Constructor Details
-
VsnetMenuItemUI
public VsnetMenuItemUI()
-
-
Method Details
-
createUI
-
installUI
- Overrides:
installUIin classComponentUI
-
installDefaults
protected void installDefaults() -
installComponents
- Parameters:
menuItem- the menu item- Since:
- 1.3
-
getPropertyPrefix
-
installListeners
protected void installListeners() -
installKeyboardActions
protected void installKeyboardActions() -
uninstallUI
- Overrides:
uninstallUIin classComponentUI
-
uninstallDefaults
protected void uninstallDefaults() -
uninstallComponents
- Parameters:
menuItem- the menu item- 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 textIconGap) -
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
-
paintCheckBox
-
paintIcon
-
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
Method which renders the text of the current menu item.- Parameters:
g- Graphics contextmenuItem- Current menu item to rendertextRect- Bounding rectangle to render the text.text- String to render
-
useCheckAndArrow
protected boolean useCheckAndArrow() -
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
-
isFloatingIcon
protected boolean isFloatingIcon() -
getIcon
-
getRightMargin
protected int getRightMargin()
-