Package com.formdev.flatlaf.ui
Class FlatToggleButtonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.basic.BasicButtonUI
-
- com.formdev.flatlaf.ui.FlatButtonUI
-
- com.formdev.flatlaf.ui.FlatToggleButtonUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI
public class FlatToggleButtonUI extends FlatButtonUI
Provides the Flat LaF UI delegate forJToggleButton
.- UiDefault:
- ToggleButton.font Font, ToggleButton.background Color, ToggleButton.foreground Color, ToggleButton.border Border, ToggleButton.margin Insets, ToggleButton.rollover boolean , Component.focusWidth int, Button.arc int, ToggleButton.minimumWidth int, ToggleButton.iconTextGap int, ToggleButton.startBackground Color optional; if set, a gradient paint is used and ToggleButton.background is ignored, ToggleButton.endBackground Color optional; if set, a gradient paint is used, ToggleButton.focusedBackground Color optional, ToggleButton.focusedForeground Color optional, ToggleButton.hoverBackground Color optional, ToggleButton.hoverForeground Color optional, ToggleButton.pressedBackground Color optional, ToggleButton.pressedForeground Color optional, ToggleButton.selectedBackground Color, ToggleButton.selectedForeground Color, ToggleButton.disabledBackground Color optional, ToggleButton.disabledText Color, ToggleButton.disabledSelectedBackground Color, ToggleButton.disabledSelectedForeground Color optional, Button.paintShadow boolean default is false, Button.shadowWidth int default is 2, Button.shadowColor Color optional, ToggleButton.toolbar.hoverBackground Color, ToggleButton.toolbar.hoverForeground Color optional, ToggleButton.toolbar.pressedBackground Color, ToggleButton.toolbar.pressedForeground Color optional, ToggleButton.toolbar.selectedBackground Color, ToggleButton.toolbar.selectedForeground Color optional, ToggleButton.toolbar.disabledSelectedBackground Color optional, ToggleButton.toolbar.disabledSelectedForeground Color optional , ToggleButton.tab.underlineHeight int, ToggleButton.tab.underlineColor Color, ToggleButton.tab.disabledUnderlineColor Color, ToggleButton.tab.selectedBackground Color optional, ToggleButton.tab.selectedForeground Color optional, ToggleButton.tab.hoverBackground Color, ToggleButton.tab.hoverForeground Color optional, ToggleButton.tab.focusBackground Color, ToggleButton.tab.focusForeground Color optional
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.formdev.flatlaf.ui.FlatButtonUI
FlatButtonUI.FlatButtonListener
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
tabDisabledUnderlineColor
protected Color
tabFocusBackground
protected Color
tabFocusForeground
protected Color
tabHoverBackground
protected Color
tabHoverForeground
protected Color
tabSelectedBackground
protected Color
tabSelectedForeground
protected Color
tabUnderlineColor
protected int
tabUnderlineHeight
-
Fields inherited from class com.formdev.flatlaf.ui.FlatButtonUI
background, buttonType, defaultBackground, defaultBoldText, defaultEndBackground, defaultFocusedBackground, defaultFocusedForeground, defaultForeground, defaultHoverBackground, defaultHoverForeground, defaultPressedBackground, defaultPressedForeground, defaultShadowColor, disabledBackground, disabledSelectedBackground, disabledSelectedForeground, disabledText, endBackground, focusedBackground, focusedForeground, foreground, hoverBackground, hoverForeground, iconTextGap, minimumHeight, minimumWidth, paintShadow, pressedBackground, pressedForeground, selectedBackground, selectedForeground, shadowColor, shadowWidth, squareSize, startBackground, toolbarDisabledSelectedBackground, toolbarDisabledSelectedForeground, toolbarHoverBackground, toolbarHoverForeground, toolbarPressedBackground, toolbarPressedForeground, toolbarSelectedBackground, toolbarSelectedForeground
-
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FlatToggleButtonUI(boolean shared)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
applyStyleProperty(AbstractButton b, String key, Object value)
static ComponentUI
createUI(JComponent c)
protected Color
getForeground(JComponent c)
protected String
getPropertyPrefix()
Map<String,Class<?>>
getStyleableInfos(JComponent c)
protected void
installDefaults(AbstractButton b)
protected void
paintBackground(Graphics g, JComponent c)
protected void
propertyChange(AbstractButton b, PropertyChangeEvent e)
protected void
uninstallDefaults(AbstractButton b)
-
Methods inherited from class com.formdev.flatlaf.ui.FlatButtonUI
applyStyle, buttonStateColor, createButtonListener, getBackground, getBackgroundBase, getForegroundBase, getPreferredSize, getStyleableValue, installStyle, installUI, isCustomBackground, isCustomForeground, isFocusPainted, paint, paintIcon, paintText, paintText, update
-
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getTextShiftOffset, installKeyboardActions, installListeners, paintButtonPressed, paintFocus, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUI
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
-
-
-
-
Field Detail
-
tabUnderlineHeight
protected int tabUnderlineHeight
-
tabUnderlineColor
protected Color tabUnderlineColor
-
tabDisabledUnderlineColor
protected Color tabDisabledUnderlineColor
-
tabSelectedBackground
protected Color tabSelectedBackground
-
tabSelectedForeground
protected Color tabSelectedForeground
- Since:
- 2.3
-
tabHoverBackground
protected Color tabHoverBackground
-
tabHoverForeground
protected Color tabHoverForeground
- Since:
- 2.3
-
tabFocusBackground
protected Color tabFocusBackground
-
tabFocusForeground
protected Color tabFocusForeground
- Since:
- 2.3
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
getPropertyPrefix
protected String getPropertyPrefix()
- Overrides:
getPropertyPrefix
in classBasicButtonUI
-
installDefaults
protected void installDefaults(AbstractButton b)
- Overrides:
installDefaults
in classFlatButtonUI
-
uninstallDefaults
protected void uninstallDefaults(AbstractButton b)
- Overrides:
uninstallDefaults
in classFlatButtonUI
-
propertyChange
protected void propertyChange(AbstractButton b, PropertyChangeEvent e)
- Overrides:
propertyChange
in classFlatButtonUI
-
applyStyleProperty
protected Object applyStyleProperty(AbstractButton b, String key, Object value)
- Overrides:
applyStyleProperty
in classFlatButtonUI
- Since:
- 2
-
getStyleableInfos
public Map<String,Class<?>> getStyleableInfos(JComponent c)
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Overrides:
getStyleableInfos
in classFlatButtonUI
- Since:
- 2
-
paintBackground
protected void paintBackground(Graphics g, JComponent c)
- Overrides:
paintBackground
in classFlatButtonUI
-
getForeground
protected Color getForeground(JComponent c)
- Overrides:
getForeground
in classFlatButtonUI
-
-