Package com.jidesoft.plaf.basic
Class BasicJideSplitButtonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.MenuItemUI
-
- com.jidesoft.plaf.vsnet.VsnetMenuItemUI
-
- com.jidesoft.plaf.vsnet.VsnetMenuUI
-
- com.jidesoft.plaf.basic.BasicJideSplitButtonUI
-
- Direct Known Subclasses:
AquaJideSplitButtonUI
public class BasicJideSplitButtonUI extends VsnetMenuUI
SplitButtonUI implementation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBasicJideSplitButtonUI.MouseInputHandler-
Nested classes/interfaces inherited from class com.jidesoft.plaf.vsnet.VsnetMenuUI
VsnetMenuUI.PostAction
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Color_darkShadowColorprotected java.awt.Color_highlightprotected boolean_isFloatingIconprotected java.awt.Color_lightHighlightColorprotected ThemePainter_painterprotected java.awt.Color_shadowColorprotected int_splitButtonMarginprotected 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
Constructors Constructor Description BasicJideSplitButtonUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.swing.event.MouseInputListenercreateMouseInputListener(javax.swing.JComponent c)static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent x)protected static voiddownButtonPressed(javax.swing.JMenu menu)protected voiddrawStringUnderlineCharAt(javax.swing.JComponent c, java.awt.Graphics g, java.lang.String text, int underlinedIndex, int x, int y)static intgetAdjustExtraWidth(java.awt.Component c, java.lang.String text, int extraWidth)protected java.awt.RectanglegetButtonRect(javax.swing.JComponent c, int orientation, int width, int height)Gets the bounds for the button part of theJideSplitButton.protected java.awt.RectanglegetDropDownRect(javax.swing.JComponent c, int orientation, int width, int height)Gets the bounds for the drop down part of theJideSplitButton.protected static java.awt.ContainergetFirstParentMenuElement(java.awt.Component comp)protected javax.swing.IcongetIcon(javax.swing.AbstractButton b)javax.swing.InputMapgetInputMap(int condition, javax.swing.JComponent c)Returns the InputMap for conditioncondition.java.awt.DimensiongetMaximumSize(javax.swing.JComponent c)static java.lang.StringgetMaxLengthWord(java.lang.String text)java.awt.DimensiongetMinimumSize(javax.swing.JComponent c)protected intgetOffset()The gap between the button part and the drop down menu part.java.awt.DimensiongetPreferredSize(javax.swing.JComponent c)protected java.lang.StringgetPropertyPrefix()protected intgetRightMargin()static java.lang.String[]getWrappedText(java.lang.String text)Gets the text after wrapping.protected voidinstallDefaults()protected voidinstallKeyboardActions()protected voidinstallListeners()protected booleanisAlwaysDropdown(javax.swing.JMenuItem menuItem)protected booleanisFloatingIcon()static voidloadActionMap(LazyActionMap map)Populates Buttons actions.protected voidpaintArrow(javax.swing.JMenuItem menuItem, java.awt.Graphics g)protected voidpaintBackground(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Color bgColor)Draws the background of the menu item.protected voidpaintIcon(javax.swing.JMenuItem b, java.awt.Graphics g)protected voidpaintRaised2Border(java.awt.Graphics g, java.awt.Rectangle b)protected voidpaintRaisedBorder(java.awt.Graphics g, java.awt.Rectangle b)protected voidpaintSunken2Border(java.awt.Graphics g, java.awt.Rectangle b)protected voidpaintSunkenBorder(java.awt.Graphics g, java.awt.Rectangle b)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 voiduninstallDefaults()protected voiduninstallKeyboardActions()protected voiduninstallListeners()protected voidupdateMnemonicBinding()-
Methods inherited from class com.jidesoft.plaf.vsnet.VsnetMenuUI
appendPath, createActionMap, createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createPopupMenuListener, createPropertyChangeListener, getActionMap, 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
-
-
-
-
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
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)
-
getPropertyPrefix
protected java.lang.String getPropertyPrefix()
- Overrides:
getPropertyPrefixin classVsnetMenuUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaultsin classVsnetMenuUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classVsnetMenuUI
-
installListeners
protected void installListeners()
- Overrides:
installListenersin classVsnetMenuUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListenersin classVsnetMenuUI
-
getInputMap
public javax.swing.InputMap getInputMap(int condition, javax.swing.JComponent c)Returns the InputMap for conditioncondition. Called as part ofinstallKeyboardActions.- Parameters:
condition- the conditionc- the component- Returns:
- the input map.
-
installKeyboardActions
protected void installKeyboardActions()
- Overrides:
installKeyboardActionsin classVsnetMenuUI
-
uninstallKeyboardActions
protected void uninstallKeyboardActions()
- Overrides:
uninstallKeyboardActionsin classVsnetMenuUI
-
createMouseInputListener
protected javax.swing.event.MouseInputListener createMouseInputListener(javax.swing.JComponent c)
- Overrides:
createMouseInputListenerin classVsnetMenuUI
-
paintBackground
protected void paintBackground(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Color bgColor)Description copied from class:VsnetMenuItemUIDraws the background of the menu item.- Overrides:
paintBackgroundin classVsnetMenuUI- Parameters:
g- the paint graphicsmenuItem- menu item to be paintedbgColor- 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 theJideSplitButton.- Parameters:
c- the component. In this case, it is theJideSplitButton.orientation- the orientation.width- the width of theJideSplitButtonheight- the height of theJideSplitButton.- 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 theJideSplitButton.- Parameters:
c- the component. In this case, it is theJideSplitButton.orientation- the orientation.width- the width of theJideSplitButtonheight- the height of theJideSplitButton.- 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:
getPreferredSizein classVsnetMenuUI
-
getMinimumSize
public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
- Overrides:
getMinimumSizein classVsnetMenuItemUI
-
getMaximumSize
public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
- Overrides:
getMaximumSizein classVsnetMenuUI
-
paintText
protected void paintText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text)Description copied from class:VsnetMenuUIMethod which renders the text of the current menu item.- Overrides:
paintTextin classVsnetMenuUI- Parameters:
g- Graphics contextmenuItem- Current menu item to rendertextRect- 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:
paintIconin classVsnetMenuItemUI
-
isFloatingIcon
protected boolean isFloatingIcon()
- Overrides:
isFloatingIconin classVsnetMenuItemUI
-
getIcon
protected javax.swing.Icon getIcon(javax.swing.AbstractButton b)
- Overrides:
getIconin classVsnetMenuItemUI
-
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:
getRightMarginin classVsnetMenuItemUI
-
loadActionMap
public static void loadActionMap(LazyActionMap map)
Populates Buttons actions.- Parameters:
map- the map
-
updateMnemonicBinding
protected void updateMnemonicBinding()
- Overrides:
updateMnemonicBindingin classVsnetMenuUI
-
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 componenttext- the textextraWidth- 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.
-
-