JIDE Common Layer 2.7.6

com.jidesoft.plaf.basic
Class BasicJideSplitButtonUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ButtonUI
          extended by javax.swing.plaf.MenuItemUI
              extended by com.jidesoft.plaf.vsnet.VsnetMenuItemUI
                  extended by com.jidesoft.plaf.vsnet.VsnetMenuUI
                      extended by com.jidesoft.plaf.basic.BasicJideSplitButtonUI
Direct Known Subclasses:
AquaJideSplitButtonUI

public class BasicJideSplitButtonUI
extends VsnetMenuUI

SplitButtonUI implementation


Nested Class Summary
protected  class BasicJideSplitButtonUI.MouseInputHandler
           
 
Nested classes/interfaces inherited from class com.jidesoft.plaf.vsnet.VsnetMenuUI
VsnetMenuUI.PostAction
 
Field Summary
protected  java.awt.Color _darkShadowColor
           
protected  java.awt.Color _highlight
           
protected  boolean _isFloatingIcon
           
protected  java.awt.Color _lightHighlightColor
           
protected  ThemePainter _painter
           
protected  java.awt.Color _shadowColor
           
protected  int _splitButtonMargin
           
protected  int _splitButtonMarginOnMenu
           
 
Fields inherited from class com.jidesoft.plaf.vsnet.VsnetMenuUI
changeListener, menuListener, propertyChangeListener
 
Fields inherited from class com.jidesoft.plaf.vsnet.VsnetMenuItemUI
acceleratorFont, acceleratorForeground, acceleratorRect, acceleratorSelectionForeground, arrowIcon, arrowIconRect, backgroundColor, borderColor, checkIcon, checkIconRect, defaultAccelEndGap, defaultShadowWidth, defaultTextIconGap, disabledForeground, iconRect, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, selectionBackground, selectionForeground, shadowColor, textRect, viewRect, windowInputMap, zeroRect
 
Constructor Summary
BasicJideSplitButtonUI()
           
 
Method Summary
protected  javax.swing.event.MouseInputListener createMouseInputListener(javax.swing.JComponent c)
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)
           
protected static void downButtonPressed(javax.swing.JMenu menu)
           
protected  void drawStringUnderlineCharAt(javax.swing.JComponent c, java.awt.Graphics g, java.lang.String text, int underlinedIndex, int x, int y)
           
static int getAdjustExtraWidth(java.awt.Component c, java.lang.String text, int extraWidth)
           
protected  java.awt.Rectangle getButtonRect(javax.swing.JComponent c, int orientation, int width, int height)
          Gets the bounds for the button part of the JideSplitButton.
protected  java.awt.Rectangle getDropDownRect(javax.swing.JComponent c, int orientation, int width, int height)
          Gets the bounds for the drop down part of the JideSplitButton.
protected static java.awt.Container getFirstParentMenuElement(java.awt.Component comp)
           
protected  javax.swing.Icon getIcon(javax.swing.AbstractButton b)
           
 javax.swing.InputMap getInputMap(int condition, javax.swing.JComponent c)
          Returns the InputMap for condition condition.
 java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
           
static java.lang.String getMaxLengthWord(java.lang.String text)
           
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
           
protected  int getOffset()
          The gap between the button part and the drop down menu part.
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
           
protected  java.lang.String getPropertyPrefix()
           
protected  int getRightMargin()
           
static java.lang.String[] getWrappedText(java.lang.String text)
          Gets the text after wrapping.
protected  void installDefaults()
           
protected  void installKeyboardActions()
           
protected  void installListeners()
           
protected  boolean isAlwaysDropdown(javax.swing.JMenuItem menuItem)
           
protected  boolean isFloatingIcon()
           
static void loadActionMap(LazyActionMap map)
          Populates Buttons actions.
protected  void paintArrow(javax.swing.JMenuItem menuItem, java.awt.Graphics g)
           
protected  void paintBackground(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Color bgColor)
          Draws the background of the menu item.
protected  void paintIcon(javax.swing.JMenuItem b, java.awt.Graphics g)
           
protected  void paintRaised2Border(java.awt.Graphics g, java.awt.Rectangle b)
           
protected  void paintRaisedBorder(java.awt.Graphics g, java.awt.Rectangle b)
           
protected  void paintSunken2Border(java.awt.Graphics g, java.awt.Rectangle b)
           
protected  void paintSunkenBorder(java.awt.Graphics g, java.awt.Rectangle b)
           
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.
protected  void uninstallDefaults()
           
protected  void uninstallKeyboardActions()
           
protected  void uninstallListeners()
           
 
Methods inherited from class com.jidesoft.plaf.vsnet.VsnetMenuUI
appendPath, createActionMap, createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createPopupMenuListener, createPropertyChangeListener, isMouseOver, setMouseOver, setupPostTimer
 
Methods inherited from class com.jidesoft.plaf.vsnet.VsnetMenuItemUI
createInputMap, doClick, getPainter, getPath, getPreferredMenuItemSize, installComponents, installUI, isDownArrowVisible, paint, paintCheckBox, paintMenuItem, uninstallComponents, uninstallUI, update, useCheckAndArrow
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_painter

protected ThemePainter _painter

_shadowColor

protected java.awt.Color _shadowColor

_darkShadowColor

protected java.awt.Color _darkShadowColor

_highlight

protected java.awt.Color _highlight

_lightHighlightColor

protected java.awt.Color _lightHighlightColor

_splitButtonMargin

protected int _splitButtonMargin

_splitButtonMarginOnMenu

protected int _splitButtonMarginOnMenu

_isFloatingIcon

protected boolean _isFloatingIcon
Constructor Detail

BasicJideSplitButtonUI

public BasicJideSplitButtonUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)

getPropertyPrefix

protected java.lang.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 javax.swing.InputMap getInputMap(int condition,
                                        javax.swing.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 javax.swing.event.MouseInputListener createMouseInputListener(javax.swing.JComponent c)
Overrides:
createMouseInputListener in class VsnetMenuUI

paintBackground

protected void paintBackground(java.awt.Graphics g,
                               javax.swing.JMenuItem menuItem,
                               java.awt.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(javax.swing.JMenuItem menuItem,
                          java.awt.Graphics g)

getDropDownRect

protected java.awt.Rectangle getDropDownRect(javax.swing.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 java.awt.Rectangle getButtonRect(javax.swing.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(java.awt.Graphics g,
                                 java.awt.Rectangle b)

paintSunken2Border

protected void paintSunken2Border(java.awt.Graphics g,
                                  java.awt.Rectangle b)

paintRaised2Border

protected void paintRaised2Border(java.awt.Graphics g,
                                  java.awt.Rectangle b)

paintRaisedBorder

protected void paintRaisedBorder(java.awt.Graphics g,
                                 java.awt.Rectangle b)

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Overrides:
getPreferredSize in class VsnetMenuUI

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
Overrides:
getMinimumSize in class VsnetMenuItemUI

getMaximumSize

public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
Overrides:
getMaximumSize in class VsnetMenuUI

paintText

protected void paintText(java.awt.Graphics g,
                         javax.swing.JMenuItem menuItem,
                         java.awt.Rectangle textRect,
                         java.lang.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(javax.swing.JComponent c,
                                         java.awt.Graphics g,
                                         java.lang.String text,
                                         int underlinedIndex,
                                         int x,
                                         int y)

paintIcon

protected void paintIcon(javax.swing.JMenuItem b,
                         java.awt.Graphics g)
Overrides:
paintIcon in class VsnetMenuItemUI

isFloatingIcon

protected boolean isFloatingIcon()
Overrides:
isFloatingIcon in class VsnetMenuItemUI

getIcon

protected javax.swing.Icon getIcon(javax.swing.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(javax.swing.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

downButtonPressed

protected static void downButtonPressed(javax.swing.JMenu menu)

getFirstParentMenuElement

protected static java.awt.Container getFirstParentMenuElement(java.awt.Component comp)

getAdjustExtraWidth

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

getMaxLengthWord

public static java.lang.String getMaxLengthWord(java.lang.String text)

getWrappedText

public static java.lang.String[] getWrappedText(java.lang.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.

JIDE Common Layer 2.7.6