Package com.jidesoft.plaf.metal
Class MetalJideSplitButtonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.MenuItemUI
-
- com.jidesoft.plaf.metal.MetalMenuItemUI
-
- com.jidesoft.plaf.metal.MetalMenuUI
-
- com.jidesoft.plaf.metal.MetalJideSplitButtonUI
-
public class MetalJideSplitButtonUI extends MetalMenuUI
MetalJideSplitButtonUI implementation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
MetalJideSplitButtonUI.MouseInputHandler
-
Nested classes/interfaces inherited from class com.jidesoft.plaf.metal.MetalMenuUI
MetalMenuUI.ChangeHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Color
_darkShadowColor
protected java.awt.Color
_highlight
protected java.awt.Color
_lightHighlightColor
protected ThemePainter
_painter
protected java.beans.PropertyChangeListener
_propertyChangeListener
protected java.awt.Color
_shadowColor
-
Fields inherited from class com.jidesoft.plaf.metal.MetalMenuUI
changeListener, menuListener, propertyChangeListener
-
Fields inherited from class com.jidesoft.plaf.metal.MetalMenuItemUI
acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, selectionBackground, selectionForeground
-
-
Constructor Summary
Constructors Constructor Description MetalJideSplitButtonUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.swing.event.MouseInputListener
createMouseInputListener(javax.swing.JComponent c)
protected java.beans.PropertyChangeListener
createSplitButtonPropertyChangeListener(javax.swing.JComponent c)
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent c)
protected static void
downButtonPressed(javax.swing.JMenu menu)
protected java.awt.Rectangle
getButtonRect(javax.swing.JComponent c, int orientation, int width, int height)
Gets the bounds for the button part of theJideSplitButton
.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
.protected static java.awt.Container
getFirstParentMenuElement(java.awt.Component comp)
javax.swing.InputMap
getInputMap(int condition, javax.swing.JComponent c)
Returns the InputMap for conditioncondition
.java.awt.Dimension
getMaximumSize(javax.swing.JComponent c)
java.awt.Dimension
getMinimumSize(javax.swing.JComponent c)
protected int
getOffset()
java.awt.Dimension
getPreferredSize(javax.swing.JComponent c)
protected java.lang.String
getPropertyPrefix()
protected int
getRightMargin()
protected void
installDefaults()
protected void
installKeyboardActions()
protected void
installListeners()
protected boolean
isAlwaysDropdown(javax.swing.JMenuItem menuItem)
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
paintText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text)
Renders the text of the current menu item.protected void
uninstallDefaults()
protected void
uninstallKeyboardActions()
protected void
uninstallListeners()
protected void
updateMnemonicBinding()
-
Methods inherited from class com.jidesoft.plaf.metal.MetalMenuUI
appendPath, createActionMap, createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createPropertyChangeListener, getActionMap, isMouseOver, setMouseOver, setupPostTimer
-
Methods inherited from class com.jidesoft.plaf.metal.MetalMenuItemUI
createInputMap, doClick, getPainter, getPath, getPreferredMenuItemSize, installComponents, installUI, isDownArrowVisible, paint, paintMenuItem, uninstallComponents, uninstallUI, update
-
-
-
-
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
-
_propertyChangeListener
protected java.beans.PropertyChangeListener _propertyChangeListener
-
-
Method Detail
-
getPropertyPrefix
protected java.lang.String getPropertyPrefix()
- Overrides:
getPropertyPrefix
in classMetalMenuUI
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classMetalMenuUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classMetalMenuUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classMetalMenuUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classMetalMenuUI
-
createSplitButtonPropertyChangeListener
protected java.beans.PropertyChangeListener createSplitButtonPropertyChangeListener(javax.swing.JComponent c)
-
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:
installKeyboardActions
in classMetalMenuUI
-
uninstallKeyboardActions
protected void uninstallKeyboardActions()
- Overrides:
uninstallKeyboardActions
in classMetalMenuUI
-
createMouseInputListener
protected javax.swing.event.MouseInputListener createMouseInputListener(javax.swing.JComponent c)
- Overrides:
createMouseInputListener
in classMetalMenuUI
-
paintBackground
protected void paintBackground(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Color bgColor)
Description copied from class:MetalMenuUI
Draws the background of the menu item.- Overrides:
paintBackground
in classMetalMenuUI
- Parameters:
g
- the paint graphicsmenuItem
- menu item to be paintedbgColor
- selection background color
-
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 theJideSplitButton
height
- the height of theJideSplitButton
.- Returns:
- the bounds for the drop down part of the
JideSplitButton
.
-
paintArrow
protected void paintArrow(javax.swing.JMenuItem menuItem, java.awt.Graphics g)
-
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 theJideSplitButton
height
- the height of theJideSplitButton
.- Returns:
- the bounds for the button part of the
JideSplitButton
.
-
paintText
protected void paintText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text)
Description copied from class:MetalMenuItemUI
Renders the text of the current menu item.- Overrides:
paintText
in classMetalMenuItemUI
- Parameters:
g
- graphics contextmenuItem
- menu item to rendertextRect
- bounding rectangle for rendering the texttext
- string to render
-
getMinimumSize
public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
- Overrides:
getMinimumSize
in classMetalMenuItemUI
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSize
in classMetalMenuUI
-
getMaximumSize
public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
- Overrides:
getMaximumSize
in classMetalMenuUI
-
paintIcon
protected void paintIcon(javax.swing.JMenuItem b, java.awt.Graphics g)
-
getOffset
protected int getOffset()
-
isAlwaysDropdown
protected boolean isAlwaysDropdown(javax.swing.JMenuItem menuItem)
-
loadActionMap
public static void loadActionMap(LazyActionMap map)
Populates Buttons actions.- Parameters:
map
- the action map to load
-
updateMnemonicBinding
protected void updateMnemonicBinding()
- Overrides:
updateMnemonicBinding
in classMetalMenuUI
-
downButtonPressed
protected static void downButtonPressed(javax.swing.JMenu menu)
-
getFirstParentMenuElement
protected static java.awt.Container getFirstParentMenuElement(java.awt.Component comp)
-
getRightMargin
protected int getRightMargin()
- Overrides:
getRightMargin
in classMetalMenuItemUI
-
-