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 ColortabDisabledUnderlineColorprotected ColortabFocusBackgroundprotected ColortabFocusForegroundprotected ColortabHoverBackgroundprotected ColortabHoverForegroundprotected ColortabSelectedBackgroundprotected ColortabSelectedForegroundprotected ColortabUnderlineColorprotected inttabUnderlineHeight-
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 protectedFlatToggleButtonUI(boolean shared)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectapplyStyleProperty(AbstractButton b, String key, Object value)static ComponentUIcreateUI(JComponent c)protected ColorgetForeground(JComponent c)protected StringgetPropertyPrefix()Map<String,Class<?>>getStyleableInfos(JComponent c)protected voidinstallDefaults(AbstractButton b)protected voidpaintBackground(Graphics g, JComponent c)protected voidpropertyChange(AbstractButton b, PropertyChangeEvent e)protected voiduninstallDefaults(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:
getPropertyPrefixin classBasicButtonUI
-
installDefaults
protected void installDefaults(AbstractButton b)
- Overrides:
installDefaultsin classFlatButtonUI
-
uninstallDefaults
protected void uninstallDefaults(AbstractButton b)
- Overrides:
uninstallDefaultsin classFlatButtonUI
-
propertyChange
protected void propertyChange(AbstractButton b, PropertyChangeEvent e)
- Overrides:
propertyChangein classFlatButtonUI
-
applyStyleProperty
protected Object applyStyleProperty(AbstractButton b, String key, Object value)
- Overrides:
applyStylePropertyin classFlatButtonUI- Since:
- 2
-
getStyleableInfos
public Map<String,Class<?>> getStyleableInfos(JComponent c)
- Specified by:
getStyleableInfosin interfaceFlatStylingSupport.StyleableUI- Overrides:
getStyleableInfosin classFlatButtonUI- Since:
- 2
-
paintBackground
protected void paintBackground(Graphics g, JComponent c)
- Overrides:
paintBackgroundin classFlatButtonUI
-
getForeground
protected Color getForeground(JComponent c)
- Overrides:
getForegroundin classFlatButtonUI
-
-