Class VsnetMenuItemUI

Direct Known Subclasses:
MetalRadioButtonMenuItemUI, VsnetCheckBoxMenuItemUI, VsnetMenuUI, VsnetRadioButtonMenuItemUI

public class VsnetMenuItemUI extends MenuItemUI
MenuItem UI implementation
  • Field Details

    • selectionBackground

      protected Color selectionBackground
    • selectionForeground

      protected Color selectionForeground
    • disabledForeground

      protected Color disabledForeground
    • acceleratorForeground

      protected Color acceleratorForeground
    • acceleratorSelectionForeground

      protected Color acceleratorSelectionForeground
    • defaultTextIconGap

      protected int defaultTextIconGap
    • acceleratorFont

      protected Font acceleratorFont
    • mouseInputListener

      protected MouseInputListener mouseInputListener
    • arrowIcon

      protected Icon arrowIcon
    • checkIcon

      protected Icon checkIcon
    • oldBorderPainted

      protected boolean oldBorderPainted
    • windowInputMap

      protected InputMap windowInputMap
      Used for accelerator binding, lazily created.
    • shadowColor

      protected Color shadowColor
    • defaultAccelEndGap

      protected int defaultAccelEndGap
    • defaultShadowWidth

      protected int defaultShadowWidth
    • borderColor

      protected Color borderColor
    • backgroundColor

      protected Color backgroundColor
    • _isFloatingIcon

      protected boolean _isFloatingIcon
    • zeroRect

      protected static Rectangle zeroRect
    • iconRect

      protected static Rectangle iconRect
    • textRect

      protected static Rectangle textRect
    • acceleratorRect

      protected static Rectangle acceleratorRect
    • checkIconRect

      protected static Rectangle checkIconRect
    • arrowIconRect

      protected static Rectangle arrowIconRect
    • viewRect

      protected static Rectangle viewRect
  • Constructor Details

    • VsnetMenuItemUI

      public VsnetMenuItemUI()
  • Method Details

    • createUI

      public static ComponentUI createUI(JComponent c)
    • installUI

      public void installUI(JComponent c)
      Overrides:
      installUI in class ComponentUI
    • installDefaults

      protected void installDefaults()
    • installComponents

      protected void installComponents(JMenuItem menuItem)
      Parameters:
      menuItem - the menu item
      Since:
      1.3
    • getPropertyPrefix

      protected String getPropertyPrefix()
    • installListeners

      protected void installListeners()
    • installKeyboardActions

      protected void installKeyboardActions()
    • uninstallUI

      public void uninstallUI(JComponent c)
      Overrides:
      uninstallUI in class ComponentUI
    • uninstallDefaults

      protected void uninstallDefaults()
    • uninstallComponents

      protected void uninstallComponents(JMenuItem menuItem)
      Parameters:
      menuItem - the menu item
      Since:
      1.3
    • uninstallListeners

      protected void uninstallListeners()
    • uninstallKeyboardActions

      protected void uninstallKeyboardActions()
    • createMouseInputListener

      protected MouseInputListener createMouseInputListener(JComponent c)
    • createMenuDragMouseListener

      protected MenuDragMouseListener createMenuDragMouseListener(JComponent c)
    • createMenuKeyListener

      protected MenuKeyListener createMenuKeyListener(JComponent c)
    • getActionMap

      protected ActionMap getActionMap()
    • createActionMap

      protected ActionMap createActionMap()
    • createInputMap

      protected InputMap createInputMap(int condition)
    • getMinimumSize

      public Dimension getMinimumSize(JComponent c)
      Overrides:
      getMinimumSize in class ComponentUI
    • getPreferredSize

      public Dimension getPreferredSize(JComponent c)
      Overrides:
      getPreferredSize in class ComponentUI
    • getMaximumSize

      public Dimension getMaximumSize(JComponent c)
      Overrides:
      getMaximumSize in class ComponentUI
    • getPreferredMenuItemSize

      protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int textIconGap)
    • update

      public 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().
      Overrides:
      update in class ComponentUI
    • paint

      public void paint(Graphics g, JComponent c)
      Overrides:
      paint in class ComponentUI
    • paintMenuItem

      protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)
    • paintCheckBox

      protected void paintCheckBox(JMenuItem b, Graphics g, Icon checkIcon)
    • paintIcon

      protected void paintIcon(JMenuItem b, Graphics g)
    • paintBackground

      protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor)
      Draws the background of the menu item.
      Parameters:
      g - the paint graphics
      menuItem - menu item to be painted
      bgColor - selection background color
      Since:
      1.4
    • paintText

      protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text)
      Method which renders the text of the current menu item.

      Parameters:
      g - Graphics context
      menuItem - Current menu item to render
      textRect - Bounding rectangle to render the text.
      text - String to render
    • useCheckAndArrow

      protected boolean useCheckAndArrow()
    • getPath

      public MenuElement[] getPath()
    • doClick

      protected void doClick(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. If null is passed as this argument, the MenuSelectionManager.defaultManager is used.
      Since:
      1.4
      See Also:
    • getPainter

      protected ThemePainter getPainter()
    • isDownArrowVisible

      protected boolean isDownArrowVisible(Container c)
    • isFloatingIcon

      protected boolean isFloatingIcon()
    • getIcon

      protected Icon getIcon(AbstractButton b)
    • getRightMargin

      protected int getRightMargin()