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 boolean
protected Font
protected Color
protected static Rectangle
protected Color
protected Icon
protected static Rectangle
protected Color
protected Color
protected Icon
protected static Rectangle
protected int
protected int
protected int
protected Color
protected static Rectangle
protected MenuDragMouseListener
protected JMenuItem
protected MenuKeyListener
protected MouseInputListener
protected boolean
protected Color
protected Color
protected Color
protected static Rectangle
protected static Rectangle
protected InputMap
Used for accelerator binding, lazily created.protected static Rectangle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ActionMap
protected InputMap
createInputMap
(int condition) protected MenuDragMouseListener
protected MenuKeyListener
protected MouseInputListener
static ComponentUI
protected void
Call this method when a menu item is to be activated.protected ActionMap
protected Icon
protected ThemePainter
getPath()
protected Dimension
getPreferredMenuItemSize
(JComponent c, Icon checkIcon, Icon arrowIcon, int textIconGap) protected String
protected int
protected void
installComponents
(JMenuItem menuItem) protected void
protected void
protected void
void
protected boolean
protected boolean
void
paint
(Graphics g, JComponent c) protected void
paintBackground
(Graphics g, JMenuItem menuItem, Color bgColor) Draws the background of the menu item.protected void
paintCheckBox
(JMenuItem b, Graphics g, Icon checkIcon) protected void
protected void
paintMenuItem
(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) protected void
Method which renders the text of the current menu item.protected void
uninstallComponents
(JMenuItem menuItem) protected void
protected void
protected void
void
void
update
(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 boolean
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 -
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:
installUI
in 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:
uninstallUI
in 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:
getMinimumSize
in classComponentUI
-
getPreferredSize
- Overrides:
getPreferredSize
in classComponentUI
-
getMaximumSize
- Overrides:
getMaximumSize
in 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:
update
in classComponentUI
-
paint
- Overrides:
paint
in 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. Ifnull
is passed as this argument, theMenuSelectionManager.defaultManager
is used.- Since:
- 1.4
- See Also:
-
getPainter
-
isDownArrowVisible
-
isFloatingIcon
protected boolean isFloatingIcon() -
getIcon
-
getRightMargin
protected int getRightMargin()
-