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 Colorprotected Colorprotected booleanprotected Colorprotected ThemePainterprotected Colorprotected intprotected intFields inherited from class com.jidesoft.plaf.vsnet.VsnetMenuUI
changeListener, menuListener, propertyChangeListenerFields 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 MouseInputListenerstatic ComponentUIprotected static voiddownButtonPressed(JMenu menu) protected voiddrawStringUnderlineCharAt(JComponent c, Graphics g, String text, int underlinedIndex, int x, int y) static intgetAdjustExtraWidth(Component c, String text, int extraWidth) protected RectanglegetButtonRect(JComponent c, int orientation, int width, int height) Gets the bounds for the button part of theJideSplitButton.protected RectanglegetDropDownRect(JComponent c, int orientation, int width, int height) Gets the bounds for the drop down part of theJideSplitButton.protected static Containerprotected IcongetInputMap(int condition, JComponent c) Returns the InputMap for conditioncondition.static StringgetMaxLengthWord(String text) protected intThe gap between the button part and the drop down menu part.protected Stringprotected intstatic String[]getWrappedText(String text) Gets the text after wrapping.protected voidprotected voidprotected voidprotected booleanisAlwaysDropdown(JMenuItem menuItem) protected booleanstatic voidPopulates Buttons actions.protected voidpaintArrow(JMenuItem menuItem, Graphics g) protected voidpaintBackground(Graphics g, JMenuItem menuItem, Color bgColor) Draws the background of the menu item.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidMethod which renders the text of the current menu item.protected voidprotected voidprotected voidprotected voidMethods inherited from class com.jidesoft.plaf.vsnet.VsnetMenuUI
appendPath, createActionMap, createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createPopupMenuListener, createPropertyChangeListener, getActionMap, isMouseOver, setMouseOver, setupPostTimerMethods inherited from class com.jidesoft.plaf.vsnet.VsnetMenuItemUI
createInputMap, doClick, getPainter, getPath, getPreferredMenuItemSize, installComponents, installUI, isDownArrowVisible, paint, paintCheckBox, paintMenuItem, uninstallComponents, uninstallUI, update, useCheckAndArrowMethods 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:
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
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
- Overrides:
createMouseInputListenerin classVsnetMenuUI
-
paintBackground
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
-
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 theJideSplitButtonheight- 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 theJideSplitButtonheight- the height of theJideSplitButton.- Returns:
- the bounds for the button part of the
JideSplitButton.
-
paintSunkenBorder
-
paintSunken2Border
-
paintRaised2Border
-
paintRaisedBorder
-
getPreferredSize
- Overrides:
getPreferredSizein classVsnetMenuUI
-
getMinimumSize
- Overrides:
getMinimumSizein classVsnetMenuItemUI
-
getMaximumSize
- Overrides:
getMaximumSizein classVsnetMenuUI
-
paintText
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(JComponent c, Graphics g, String text, int underlinedIndex, int x, int y) -
paintIcon
- Overrides:
paintIconin classVsnetMenuItemUI
-
isFloatingIcon
protected boolean isFloatingIcon()- Overrides:
isFloatingIconin classVsnetMenuItemUI
-
getIcon
- Overrides:
getIconin 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:
getRightMarginin classVsnetMenuItemUI
-
loadActionMap
Populates Buttons actions.- Parameters:
map- the map
-
updateMnemonicBinding
protected void updateMnemonicBinding()- Overrides:
updateMnemonicBindingin 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.
-