Package com.formdev.flatlaf.ui
Class FlatButtonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.basic.BasicButtonUI
-
- com.formdev.flatlaf.ui.FlatButtonUI
-
- Direct Known Subclasses:
FlatToggleButtonUI
public class FlatButtonUI extends BasicButtonUI
Provides the Flat LaF UI delegate forJButton.- UiDefault:
- Button.font Font, Button.background Color, Button.foreground Color, Button.border Border, Button.margin Insets, Button.rollover boolean , Button.minimumWidth int, Button.iconTextGap int, Button.startBackground Color optional; if set, a gradient paint is used and Button.background is ignored, Button.endBackground Color optional; if set, a gradient paint is used, Button.focusedBackground Color optional, Button.hoverBackground Color optional, Button.pressedBackground Color optional, Button.selectedBackground Color, Button.selectedForeground Color, Button.disabledBackground Color optional, Button.disabledText Color, Button.disabledSelectedBackground Color, Button.default.background Color, Button.default.startBackground Color optional; if set, a gradient paint is used and Button.default.background is ignored, Button.default.endBackground Color optional; if set, a gradient paint is used, Button.default.foreground Color, Button.default.focusedBackground Color optional, Button.default.hoverBackground Color optional, Button.default.pressedBackground Color optional, Button.default.boldText boolean, Button.paintShadow boolean default is false, Button.shadowWidth int default is 2, Button.shadowColor Color optional, Button.default.shadowColor Color optional, Button.toolbar.spacingInsets Insets, Button.toolbar.hoverBackground Color, Button.toolbar.pressedBackground Color, Button.toolbar.selectedBackground Color
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFlatButtonUI.FlatButtonListener
-
Field Summary
Fields Modifier and Type Field Description protected Colorbackgroundprotected ColordefaultBackgroundprotected booleandefaultBoldTextprotected ColordefaultEndBackgroundprotected ColordefaultFocusedBackgroundprotected ColordefaultForegroundprotected ColordefaultHoverBackgroundprotected ColordefaultPressedBackgroundprotected ColordefaultShadowColorprotected ColordisabledBackgroundprotected ColordisabledSelectedBackgroundprotected ColordisabledTextprotected ColorendBackgroundprotected ColorfocusedBackgroundprotected Colorforegroundprotected ColorhoverBackgroundprotected inticonTextGapprotected intminimumWidthprotected ColorpressedBackgroundprotected ColorselectedBackgroundprotected ColorselectedForegroundprotected ColorshadowColorprotected intshadowWidthprotected ColorstartBackgroundprotected ColortoolbarHoverBackgroundprotected ColortoolbarPressedBackgroundprotected ColortoolbarSelectedBackgroundprotected InsetstoolbarSpacingInsets-
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
-
-
Constructor Summary
Constructors Constructor Description FlatButtonUI()
-
Method Summary
-
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installListeners, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUI
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
-
-
-
-
Field Detail
-
minimumWidth
protected int minimumWidth
-
iconTextGap
protected int iconTextGap
-
background
protected Color background
-
foreground
protected Color foreground
-
startBackground
protected Color startBackground
-
endBackground
protected Color endBackground
-
focusedBackground
protected Color focusedBackground
-
hoverBackground
protected Color hoverBackground
-
pressedBackground
protected Color pressedBackground
-
selectedBackground
protected Color selectedBackground
-
selectedForeground
protected Color selectedForeground
-
disabledBackground
protected Color disabledBackground
-
disabledText
protected Color disabledText
-
disabledSelectedBackground
protected Color disabledSelectedBackground
-
defaultBackground
protected Color defaultBackground
-
defaultEndBackground
protected Color defaultEndBackground
-
defaultForeground
protected Color defaultForeground
-
defaultFocusedBackground
protected Color defaultFocusedBackground
-
defaultHoverBackground
protected Color defaultHoverBackground
-
defaultPressedBackground
protected Color defaultPressedBackground
-
defaultBoldText
protected boolean defaultBoldText
-
shadowWidth
protected int shadowWidth
-
shadowColor
protected Color shadowColor
-
defaultShadowColor
protected Color defaultShadowColor
-
toolbarSpacingInsets
protected Insets toolbarSpacingInsets
-
toolbarHoverBackground
protected Color toolbarHoverBackground
-
toolbarPressedBackground
protected Color toolbarPressedBackground
-
toolbarSelectedBackground
protected Color toolbarSelectedBackground
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installDefaults
protected void installDefaults(AbstractButton b)
- Overrides:
installDefaultsin classBasicButtonUI
-
uninstallDefaults
protected void uninstallDefaults(AbstractButton b)
- Overrides:
uninstallDefaultsin classBasicButtonUI
-
createButtonListener
protected BasicButtonListener createButtonListener(AbstractButton b)
- Overrides:
createButtonListenerin classBasicButtonUI
-
propertyChange
protected void propertyChange(AbstractButton b, PropertyChangeEvent e)
-
isFocusPainted
public static boolean isFocusPainted(Component c)
-
update
public void update(Graphics g, JComponent c)
- Overrides:
updatein classComponentUI
-
paintBackground
protected void paintBackground(Graphics g, JComponent c)
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paintin classBasicButtonUI
-
paintText
protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text)
- Overrides:
paintTextin classBasicButtonUI
-
paintText
public static void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text, Color foreground)
-
getBackground
protected Color getBackground(JComponent c)
-
getBackgroundBase
protected Color getBackgroundBase(JComponent c, boolean def)
-
isCustomBackground
protected boolean isCustomBackground(Color bg)
-
buttonStateColor
public static Color buttonStateColor(Component c, Color enabledColor, Color disabledColor, Color focusedColor, Color hoverColor, Color pressedColor)
-
getForeground
protected Color getForeground(JComponent c)
-
isCustomForeground
protected boolean isCustomForeground(Color fg)
-
getPreferredSize
public Dimension getPreferredSize(JComponent c)
- Overrides:
getPreferredSizein classBasicButtonUI
-
-