Class BasicJideSplitButtonUI

Direct Known Subclasses:
AquaJideSplitButtonUI

public class BasicJideSplitButtonUI extends VsnetMenuUI
SplitButtonUI implementation
  • Field Details

    • _painter

      protected ThemePainter _painter
    • _shadowColor

      protected Color _shadowColor
    • _darkShadowColor

      protected Color _darkShadowColor
    • _highlight

      protected Color _highlight
    • _lightHighlightColor

      protected Color _lightHighlightColor
    • _splitButtonMargin

      protected int _splitButtonMargin
    • _splitButtonMarginOnMenu

      protected int _splitButtonMarginOnMenu
    • _isFloatingIcon

      protected boolean _isFloatingIcon
  • Constructor Details

    • BasicJideSplitButtonUI

      public BasicJideSplitButtonUI()
  • Method Details

    • createUI

      public static ComponentUI createUI(JComponent x)
    • getPropertyPrefix

      protected String getPropertyPrefix()
      Overrides:
      getPropertyPrefix in class VsnetMenuUI
    • installDefaults

      protected void installDefaults()
      Overrides:
      installDefaults in class VsnetMenuUI
    • uninstallDefaults

      protected void uninstallDefaults()
      Overrides:
      uninstallDefaults in class VsnetMenuUI
    • installListeners

      protected void installListeners()
      Overrides:
      installListeners in class VsnetMenuUI
    • uninstallListeners

      protected void uninstallListeners()
      Overrides:
      uninstallListeners in class VsnetMenuUI
    • getInputMap

      public InputMap getInputMap(int condition, JComponent c)
      Returns the InputMap for condition condition. Called as part of installKeyboardActions.
      Parameters:
      condition - the condition
      c - the component
      Returns:
      the input map.
    • installKeyboardActions

      protected void installKeyboardActions()
      Overrides:
      installKeyboardActions in class VsnetMenuUI
    • uninstallKeyboardActions

      protected void uninstallKeyboardActions()
      Overrides:
      uninstallKeyboardActions in class VsnetMenuUI
    • createMouseInputListener

      protected MouseInputListener createMouseInputListener(JComponent c)
      Overrides:
      createMouseInputListener in class VsnetMenuUI
    • paintBackground

      protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor)
      Description copied from class: VsnetMenuItemUI
      Draws the background of the menu item.
      Overrides:
      paintBackground in class VsnetMenuUI
      Parameters:
      g - the paint graphics
      menuItem - menu item to be painted
      bgColor - selection background color
    • paintArrow

      protected void paintArrow(JMenuItem menuItem, Graphics g)
    • getDropDownRect

      protected Rectangle getDropDownRect(JComponent c, int orientation, int width, int height)
      Gets the bounds for the drop down part of the JideSplitButton.
      Parameters:
      c - the component. In this case, it is the JideSplitButton.
      orientation - the orientation.
      width - the width of the JideSplitButton
      height - the height of the JideSplitButton.
      Returns:
      the bounds for the drop down part of the JideSplitButton.
    • getButtonRect

      protected Rectangle getButtonRect(JComponent c, int orientation, int width, int height)
      Gets the bounds for the button part of the JideSplitButton.
      Parameters:
      c - the component. In this case, it is the JideSplitButton.
      orientation - the orientation.
      width - the width of the JideSplitButton
      height - the height of the JideSplitButton.
      Returns:
      the bounds for the button part of the JideSplitButton.
    • paintSunkenBorder

      protected void paintSunkenBorder(Graphics g, Rectangle b)
    • paintSunken2Border

      protected void paintSunken2Border(Graphics g, Rectangle b)
    • paintRaised2Border

      protected void paintRaised2Border(Graphics g, Rectangle b)
    • paintRaisedBorder

      protected void paintRaisedBorder(Graphics g, Rectangle b)
    • getPreferredSize

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

      public Dimension getMinimumSize(JComponent c)
      Overrides:
      getMinimumSize in class VsnetMenuItemUI
    • getMaximumSize

      public Dimension getMaximumSize(JComponent c)
      Overrides:
      getMaximumSize in class VsnetMenuUI
    • paintText

      protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text)
      Description copied from class: VsnetMenuUI
      Method which renders the text of the current menu item.

      Overrides:
      paintText in class VsnetMenuUI
      Parameters:
      g - Graphics context
      menuItem - Current menu item to render
      textRect - Bounding rectangle to render the text.
      text - String to render
    • drawStringUnderlineCharAt

      protected void drawStringUnderlineCharAt(JComponent c, Graphics g, String text, int underlinedIndex, int x, int y)
    • paintIcon

      protected void paintIcon(JMenuItem b, Graphics g)
      Overrides:
      paintIcon in class VsnetMenuItemUI
    • isFloatingIcon

      protected boolean isFloatingIcon()
      Overrides:
      isFloatingIcon in class VsnetMenuItemUI
    • getIcon

      protected Icon getIcon(AbstractButton b)
      Overrides:
      getIcon in class VsnetMenuItemUI
    • getOffset

      protected int getOffset()
      The gap between the button part and the drop down menu part.
      Returns:
      the gap.
    • isAlwaysDropdown

      protected boolean isAlwaysDropdown(JMenuItem menuItem)
    • getRightMargin

      protected int getRightMargin()
      Overrides:
      getRightMargin in class VsnetMenuItemUI
    • loadActionMap

      public static void loadActionMap(LazyActionMap map)
      Populates Buttons actions.
      Parameters:
      map - the map
    • updateMnemonicBinding

      protected void updateMnemonicBinding()
      Overrides:
      updateMnemonicBinding in class VsnetMenuUI
    • downButtonPressed

      protected static void downButtonPressed(JMenu menu)
    • getFirstParentMenuElement

      protected static Container getFirstParentMenuElement(Component comp)
    • getAdjustExtraWidth

      public static int getAdjustExtraWidth(Component c, String text, int extraWidth)
      Parameters:
      c - the component
      text - the text
      extraWidth - the extra width
      Returns:
      the adjusted width.
    • getMaxLengthWord

      public static String getMaxLengthWord(String text)
    • getWrappedText

      public static String[] getWrappedText(String text)
      Gets the text after wrapping. Please note, it will only wrap text into two lines thus it is not designed for general usage.
      Parameters:
      text - the text
      Returns:
      the two lines.