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
SplitButtonUI implementation
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.jidesoft.plaf.vsnet.VsnetMenuUI
VsnetMenuUI.PostAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Color
protected Color
protected boolean
protected Color
protected ThemePainter
protected Color
protected int
protected int
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected MouseInputListener
static ComponentUI
protected static void
downButtonPressed
(JMenu menu) protected void
drawStringUnderlineCharAt
(JComponent c, Graphics g, String text, int underlinedIndex, int x, int y) static int
getAdjustExtraWidth
(Component c, String text, int extraWidth) protected Rectangle
getButtonRect
(JComponent c, int orientation, int width, int height) Gets the bounds for the button part of theJideSplitButton
.protected Rectangle
getDropDownRect
(JComponent c, int orientation, int width, int height) Gets the bounds for the drop down part of theJideSplitButton
.protected static Container
protected Icon
getInputMap
(int condition, JComponent c) Returns the InputMap for conditioncondition
.static String
getMaxLengthWord
(String text) protected int
The gap between the button part and the drop down menu part.protected String
protected int
static String[]
getWrappedText
(String text) Gets the text after wrapping.protected void
protected void
protected void
protected boolean
isAlwaysDropdown
(JMenuItem menuItem) protected boolean
static void
Populates Buttons actions.protected void
paintArrow
(JMenuItem menuItem, Graphics g) protected void
paintBackground
(Graphics g, JMenuItem menuItem, Color bgColor) Draws the background of the menu item.protected void
protected void
protected void
protected void
protected void
protected void
Method which renders the text of the current menu item.protected void
protected void
protected void
protected void
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
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
-
Field Details
-
_painter
-
_shadowColor
-
_darkShadowColor
-
_highlight
-
_lightHighlightColor
-
_splitButtonMargin
protected int _splitButtonMargin -
_splitButtonMarginOnMenu
protected int _splitButtonMarginOnMenu -
_isFloatingIcon
protected boolean _isFloatingIcon
-
-
Constructor Details
-
BasicJideSplitButtonUI
public BasicJideSplitButtonUI()
-
-
Method Details
-
createUI
-
getPropertyPrefix
- Overrides:
getPropertyPrefix
in classVsnetMenuUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaults
in classVsnetMenuUI
-
uninstallDefaults
protected void uninstallDefaults()- Overrides:
uninstallDefaults
in classVsnetMenuUI
-
installListeners
protected void installListeners()- Overrides:
installListeners
in classVsnetMenuUI
-
uninstallListeners
protected void uninstallListeners()- Overrides:
uninstallListeners
in classVsnetMenuUI
-
getInputMap
Returns the InputMap for conditioncondition
. Called as part ofinstallKeyboardActions
.- Parameters:
condition
- the conditionc
- the component- Returns:
- the input map.
-
installKeyboardActions
protected void installKeyboardActions()- Overrides:
installKeyboardActions
in classVsnetMenuUI
-
uninstallKeyboardActions
protected void uninstallKeyboardActions()- Overrides:
uninstallKeyboardActions
in classVsnetMenuUI
-
createMouseInputListener
- Overrides:
createMouseInputListener
in classVsnetMenuUI
-
paintBackground
Description copied from class:VsnetMenuItemUI
Draws the background of the menu item.- Overrides:
paintBackground
in classVsnetMenuUI
- Parameters:
g
- the paint graphicsmenuItem
- menu item to be paintedbgColor
- selection background color
-
paintArrow
-
getDropDownRect
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 theJideSplitButton
height
- the height of theJideSplitButton
.- Returns:
- the bounds for the drop down part of the
JideSplitButton
.
-
getButtonRect
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 theJideSplitButton
height
- the height of theJideSplitButton
.- Returns:
- the bounds for the button part of the
JideSplitButton
.
-
paintSunkenBorder
-
paintSunken2Border
-
paintRaised2Border
-
paintRaisedBorder
-
getPreferredSize
- Overrides:
getPreferredSize
in classVsnetMenuUI
-
getMinimumSize
- Overrides:
getMinimumSize
in classVsnetMenuItemUI
-
getMaximumSize
- Overrides:
getMaximumSize
in classVsnetMenuUI
-
paintText
Description copied from class:VsnetMenuUI
Method which renders the text of the current menu item.- Overrides:
paintText
in classVsnetMenuUI
- Parameters:
g
- Graphics contextmenuItem
- Current menu item to rendertextRect
- 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
- Overrides:
paintIcon
in classVsnetMenuItemUI
-
isFloatingIcon
protected boolean isFloatingIcon()- Overrides:
isFloatingIcon
in classVsnetMenuItemUI
-
getIcon
- Overrides:
getIcon
in classVsnetMenuItemUI
-
getOffset
protected int getOffset()The gap between the button part and the drop down menu part.- Returns:
- the gap.
-
isAlwaysDropdown
-
getRightMargin
protected int getRightMargin()- Overrides:
getRightMargin
in classVsnetMenuItemUI
-
loadActionMap
Populates Buttons actions.- Parameters:
map
- the map
-
updateMnemonicBinding
protected void updateMnemonicBinding()- Overrides:
updateMnemonicBinding
in classVsnetMenuUI
-
downButtonPressed
-
getFirstParentMenuElement
-
getAdjustExtraWidth
- Parameters:
c
- the componenttext
- the textextraWidth
- the extra width- Returns:
- the adjusted width.
-
getMaxLengthWord
-
getWrappedText
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.
-