public class VsnetMenuItemUI extends MenuItemUI
| Modifier and Type | Class and Description |
|---|---|
protected class |
VsnetMenuItemUI.MouseInputHandler |
| Constructor and Description |
|---|
VsnetMenuItemUI() |
| Modifier and Type | Method and Description |
|---|---|
protected ActionMap |
createActionMap() |
protected InputMap |
createInputMap(int condition) |
protected MenuDragMouseListener |
createMenuDragMouseListener(JComponent c) |
protected MenuKeyListener |
createMenuKeyListener(JComponent c) |
protected MouseInputListener |
createMouseInputListener(JComponent c) |
static ComponentUI |
createUI(JComponent c) |
protected void |
doClick(MenuSelectionManager msm)
Call this method when a menu item is to be activated.
|
protected ActionMap |
getActionMap() |
protected Icon |
getIcon(AbstractButton b) |
Dimension |
getMaximumSize(JComponent c) |
Dimension |
getMinimumSize(JComponent c) |
protected ThemePainter |
getPainter() |
MenuElement[] |
getPath() |
protected Dimension |
getPreferredMenuItemSize(JComponent c,
Icon checkIcon,
Icon arrowIcon,
int textIconGap) |
Dimension |
getPreferredSize(JComponent c) |
protected String |
getPropertyPrefix() |
protected int |
getRightMargin() |
protected void |
installComponents(JMenuItem menuItem) |
protected void |
installDefaults() |
protected void |
installKeyboardActions() |
protected void |
installListeners() |
void |
installUI(JComponent c) |
protected boolean |
isDownArrowVisible(Container c) |
protected boolean |
isFloatingIcon() |
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 |
paintIcon(JMenuItem b,
Graphics g) |
protected void |
paintMenuItem(Graphics g,
JComponent c,
Icon checkIcon,
Icon arrowIcon,
Color background,
Color foreground,
int defaultTextIconGap) |
protected void |
paintText(Graphics g,
JMenuItem menuItem,
Rectangle textRect,
String text)
Method which renders the text of the current menu item.
|
protected void |
uninstallComponents(JMenuItem menuItem) |
protected void |
uninstallDefaults() |
protected void |
uninstallKeyboardActions() |
protected void |
uninstallListeners() |
void |
uninstallUI(JComponent c) |
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 |
useCheckAndArrow() |
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehaviorprotected JMenuItem menuItem
protected Color selectionBackground
protected Color selectionForeground
protected Color disabledForeground
protected Color acceleratorForeground
protected Color acceleratorSelectionForeground
protected int defaultTextIconGap
protected Font acceleratorFont
protected MouseInputListener mouseInputListener
protected MenuDragMouseListener menuDragMouseListener
protected MenuKeyListener menuKeyListener
protected Icon arrowIcon
protected Icon checkIcon
protected boolean oldBorderPainted
protected InputMap windowInputMap
protected Color shadowColor
protected int defaultAccelEndGap
protected int defaultShadowWidth
protected Color borderColor
protected Color backgroundColor
protected boolean _isFloatingIcon
protected static Rectangle zeroRect
protected static Rectangle iconRect
protected static Rectangle textRect
protected static Rectangle acceleratorRect
protected static Rectangle checkIconRect
protected static Rectangle arrowIconRect
protected static Rectangle viewRect
public static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
installUI in class ComponentUIprotected void installDefaults()
protected void installComponents(JMenuItem menuItem)
menuItem - the menu itemprotected String getPropertyPrefix()
protected void installListeners()
protected void installKeyboardActions()
public void uninstallUI(JComponent c)
uninstallUI in class ComponentUIprotected void uninstallDefaults()
protected void uninstallComponents(JMenuItem menuItem)
menuItem - the menu itemprotected void uninstallListeners()
protected void uninstallKeyboardActions()
protected MouseInputListener createMouseInputListener(JComponent c)
protected MenuDragMouseListener createMenuDragMouseListener(JComponent c)
protected MenuKeyListener createMenuKeyListener(JComponent c)
protected ActionMap getActionMap()
protected ActionMap createActionMap()
protected InputMap createInputMap(int condition)
public Dimension getMinimumSize(JComponent c)
getMinimumSize in class ComponentUIpublic Dimension getPreferredSize(JComponent c)
getPreferredSize in class ComponentUIpublic Dimension getMaximumSize(JComponent c)
getMaximumSize in class ComponentUIprotected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int textIconGap)
public void update(Graphics g, JComponent c)
update in class ComponentUIpublic void paint(Graphics g, JComponent c)
paint in class ComponentUIprotected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor)
g - the paint graphicsmenuItem - menu item to be paintedbgColor - selection background colorprotected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text)
g - Graphics contextmenuItem - Current menu item to rendertextRect - Bounding rectangle to render the text.text - String to renderprotected boolean useCheckAndArrow()
public MenuElement[] getPath()
protected void doClick(MenuSelectionManager msm)
msm - A MenuSelectionManager. The visual feedback and internal bookkeeping tasks are delegated to this
MenuSelectionManager. If null is passed as this argument, the
MenuSelectionManager.defaultManager is used.MenuSelectionManager,
AbstractButton.doClick(int)protected ThemePainter getPainter()
protected boolean isDownArrowVisible(Container c)
protected boolean isFloatingIcon()
protected Icon getIcon(AbstractButton b)
protected int getRightMargin()
Copyright © 2017. All rights reserved.