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
public class VsnetMenuItemUI extends javax.swing.plaf.MenuItemUIMenuItem UI implementation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classVsnetMenuItemUI.MouseInputHandler
-
Field Summary
Fields Modifier and Type Field Description protected boolean_isFloatingIconprotected java.awt.FontacceleratorFontprotected java.awt.ColoracceleratorForegroundprotected static java.awt.RectangleacceleratorRectprotected java.awt.ColoracceleratorSelectionForegroundprotected javax.swing.IconarrowIconprotected static java.awt.RectanglearrowIconRectprotected java.awt.ColorbackgroundColorprotected java.awt.ColorborderColorprotected javax.swing.IconcheckIconprotected static java.awt.RectanglecheckIconRectprotected intdefaultAccelEndGapprotected intdefaultShadowWidthprotected intdefaultTextIconGapprotected java.awt.ColordisabledForegroundprotected static java.awt.RectangleiconRectprotected javax.swing.event.MenuDragMouseListenermenuDragMouseListenerprotected javax.swing.JMenuItemmenuItemprotected javax.swing.event.MenuKeyListenermenuKeyListenerprotected javax.swing.event.MouseInputListenermouseInputListenerprotected booleanoldBorderPaintedprotected java.awt.ColorselectionBackgroundprotected java.awt.ColorselectionForegroundprotected java.awt.ColorshadowColorprotected static java.awt.RectangletextRectprotected static java.awt.RectangleviewRectprotected javax.swing.InputMapwindowInputMapUsed for accelerator binding, lazily created.protected static java.awt.RectanglezeroRect
-
Constructor Summary
Constructors Constructor Description VsnetMenuItemUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.swing.ActionMapcreateActionMap()protected javax.swing.InputMapcreateInputMap(int condition)protected javax.swing.event.MenuDragMouseListenercreateMenuDragMouseListener(javax.swing.JComponent c)protected javax.swing.event.MenuKeyListenercreateMenuKeyListener(javax.swing.JComponent c)protected javax.swing.event.MouseInputListenercreateMouseInputListener(javax.swing.JComponent c)static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)protected voiddoClick(javax.swing.MenuSelectionManager msm)Call this method when a menu item is to be activated.protected javax.swing.ActionMapgetActionMap()protected javax.swing.IcongetIcon(javax.swing.AbstractButton b)java.awt.DimensiongetMaximumSize(javax.swing.JComponent c)java.awt.DimensiongetMinimumSize(javax.swing.JComponent c)protected ThemePaintergetPainter()javax.swing.MenuElement[]getPath()protected java.awt.DimensiongetPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, int textIconGap)java.awt.DimensiongetPreferredSize(javax.swing.JComponent c)protected java.lang.StringgetPropertyPrefix()protected intgetRightMargin()protected voidinstallComponents(javax.swing.JMenuItem menuItem)protected voidinstallDefaults()protected voidinstallKeyboardActions()protected voidinstallListeners()voidinstallUI(javax.swing.JComponent c)protected booleanisDownArrowVisible(java.awt.Container c)protected booleanisFloatingIcon()voidpaint(java.awt.Graphics g, javax.swing.JComponent c)protected voidpaintBackground(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Color bgColor)Draws the background of the menu item.protected voidpaintCheckBox(javax.swing.JMenuItem b, java.awt.Graphics g, javax.swing.Icon checkIcon)protected voidpaintIcon(javax.swing.JMenuItem b, java.awt.Graphics g)protected voidpaintMenuItem(java.awt.Graphics g, javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, java.awt.Color background, java.awt.Color foreground, int defaultTextIconGap)protected voidpaintText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text)Method which renders the text of the current menu item.protected voiduninstallComponents(javax.swing.JMenuItem menuItem)protected voiduninstallDefaults()protected voiduninstallKeyboardActions()protected voiduninstallListeners()voiduninstallUI(javax.swing.JComponent c)voidupdate(java.awt.Graphics g, javax.swing.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 booleanuseCheckAndArrow()
-
-
-
Field Detail
-
menuItem
protected javax.swing.JMenuItem menuItem
-
selectionBackground
protected java.awt.Color selectionBackground
-
selectionForeground
protected java.awt.Color selectionForeground
-
disabledForeground
protected java.awt.Color disabledForeground
-
acceleratorForeground
protected java.awt.Color acceleratorForeground
-
acceleratorSelectionForeground
protected java.awt.Color acceleratorSelectionForeground
-
defaultTextIconGap
protected int defaultTextIconGap
-
acceleratorFont
protected java.awt.Font acceleratorFont
-
mouseInputListener
protected javax.swing.event.MouseInputListener mouseInputListener
-
menuDragMouseListener
protected javax.swing.event.MenuDragMouseListener menuDragMouseListener
-
menuKeyListener
protected javax.swing.event.MenuKeyListener menuKeyListener
-
arrowIcon
protected javax.swing.Icon arrowIcon
-
checkIcon
protected javax.swing.Icon checkIcon
-
oldBorderPainted
protected boolean oldBorderPainted
-
windowInputMap
protected javax.swing.InputMap windowInputMap
Used for accelerator binding, lazily created.
-
shadowColor
protected java.awt.Color shadowColor
-
defaultAccelEndGap
protected int defaultAccelEndGap
-
defaultShadowWidth
protected int defaultShadowWidth
-
borderColor
protected java.awt.Color borderColor
-
backgroundColor
protected java.awt.Color backgroundColor
-
_isFloatingIcon
protected boolean _isFloatingIcon
-
zeroRect
protected static java.awt.Rectangle zeroRect
-
iconRect
protected static java.awt.Rectangle iconRect
-
textRect
protected static java.awt.Rectangle textRect
-
acceleratorRect
protected static java.awt.Rectangle acceleratorRect
-
checkIconRect
protected static java.awt.Rectangle checkIconRect
-
arrowIconRect
protected static java.awt.Rectangle arrowIconRect
-
viewRect
protected static java.awt.Rectangle viewRect
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUIin classjavax.swing.plaf.ComponentUI
-
installDefaults
protected void installDefaults()
-
installComponents
protected void installComponents(javax.swing.JMenuItem menuItem)
- Parameters:
menuItem- the menu item- Since:
- 1.3
-
getPropertyPrefix
protected java.lang.String getPropertyPrefix()
-
installListeners
protected void installListeners()
-
installKeyboardActions
protected void installKeyboardActions()
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUIin classjavax.swing.plaf.ComponentUI
-
uninstallDefaults
protected void uninstallDefaults()
-
uninstallComponents
protected void uninstallComponents(javax.swing.JMenuItem menuItem)
- Parameters:
menuItem- the menu item- Since:
- 1.3
-
uninstallListeners
protected void uninstallListeners()
-
uninstallKeyboardActions
protected void uninstallKeyboardActions()
-
createMouseInputListener
protected javax.swing.event.MouseInputListener createMouseInputListener(javax.swing.JComponent c)
-
createMenuDragMouseListener
protected javax.swing.event.MenuDragMouseListener createMenuDragMouseListener(javax.swing.JComponent c)
-
createMenuKeyListener
protected javax.swing.event.MenuKeyListener createMenuKeyListener(javax.swing.JComponent c)
-
getActionMap
protected javax.swing.ActionMap getActionMap()
-
createActionMap
protected javax.swing.ActionMap createActionMap()
-
createInputMap
protected javax.swing.InputMap createInputMap(int condition)
-
getMinimumSize
public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
- Overrides:
getMinimumSizein classjavax.swing.plaf.ComponentUI
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSizein classjavax.swing.plaf.ComponentUI
-
getMaximumSize
public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
- Overrides:
getMaximumSizein classjavax.swing.plaf.ComponentUI
-
getPreferredMenuItemSize
protected java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, int textIconGap)
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)We draw the background in paintMenuItem() so override update (which fills the background of opaque components by default) to just call paint().- Overrides:
updatein classjavax.swing.plaf.ComponentUI
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
paintin classjavax.swing.plaf.ComponentUI
-
paintMenuItem
protected void paintMenuItem(java.awt.Graphics g, javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, java.awt.Color background, java.awt.Color foreground, int defaultTextIconGap)
-
paintCheckBox
protected void paintCheckBox(javax.swing.JMenuItem b, java.awt.Graphics g, javax.swing.Icon checkIcon)
-
paintIcon
protected void paintIcon(javax.swing.JMenuItem b, java.awt.Graphics g)
-
paintBackground
protected void paintBackground(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Color bgColor)Draws the background of the menu item.- Parameters:
g- the paint graphicsmenuItem- menu item to be paintedbgColor- selection background color- Since:
- 1.4
-
paintText
protected void paintText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text)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
public javax.swing.MenuElement[] getPath()
-
doClick
protected void doClick(javax.swing.MenuSelectionManager msm)
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:
MenuSelectionManager,AbstractButton.doClick(int)
-
getPainter
protected ThemePainter getPainter()
-
isDownArrowVisible
protected boolean isDownArrowVisible(java.awt.Container c)
-
isFloatingIcon
protected boolean isFloatingIcon()
-
getIcon
protected javax.swing.Icon getIcon(javax.swing.AbstractButton b)
-
getRightMargin
protected int getRightMargin()
-
-