Package com.formdev.flatlaf.ui
Class FlatButtonBorder
- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- javax.swing.plaf.basic.BasicBorders.MarginBorder
-
- com.formdev.flatlaf.ui.FlatBorder
-
- com.formdev.flatlaf.ui.FlatButtonBorder
-
- All Implemented Interfaces:
Serializable,Border,UIResource
public class FlatButtonBorder extends FlatBorder
Border forJButton.- See Also:
- Serialized Form
- UiDefault:
- Button.borderColor Color, Button.startBorderColor Color optional; if set, a gradient paint is used and Button.borderColor is ignored, Button.endBorderColor Color optional; if set, a gradient paint is used, Button.disabledBorderColor Color, Button.focusedBorderColor Color, Button.hoverBorderColor Color optional, Button.default.borderColor Color, Button.default.startBorderColor Color optional; if set, a gradient paint is used and Button.default.borderColor is ignored, Button.default.endBorderColor Color optional; if set, a gradient paint is used, Button.default.hoverBorderColor Color optional, Button.default.focusedBorderColor Color, Button.default.focusColor Color, Button.toolbar.focusColor Color optional; defaults to Component.focusColor, Button.borderWidth int, Button.default.borderWidth int, Button.innerFocusWidth int or float optional; defaults to Component.innerFocusWidth, Button.toolbar.margin Insets, Button.toolbar.spacingInsets Insets, Button.toolbar.focusWidth int or float optional; default is 1, Button.arc int
-
-
Field Summary
Fields Modifier and Type Field Description protected intarcprotected ColorborderColorprotected intborderWidthprotected floatbuttonInnerFocusWidthprotected ColordefaultBorderColorprotected intdefaultBorderWidthprotected ColordefaultEndBorderColorprotected ColordefaultFocusColorprotected ColordefaultFocusedBorderColorprotected ColordefaultHoverBorderColorprotected ColordisabledBorderColorprotected ColorendBorderColorprotected ColorfocusedBorderColorprotected ColorhoverBorderColorprotected ColortoolbarFocusColorprotected floattoolbarFocusWidthprotected InsetstoolbarMarginprotected InsetstoolbarSpacingInsets-
Fields inherited from class com.formdev.flatlaf.ui.FlatBorder
customBorderColor, errorBorderColor, errorFocusedBorderColor, focusColor, focusWidth, innerFocusWidth, innerOutlineWidth, warningBorderColor, warningFocusedBorderColor
-
-
Constructor Summary
Constructors Constructor Description FlatButtonBorder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetArc(Component c)Returns the (unscaled) arc diameter of the border.protected PaintgetBorderColor(Component c)InsetsgetBorderInsets(Component c, Insets insets)protected intgetBorderWidth(Component c)Returns the (unscaled) line thickness used to paint the border.protected ColorgetFocusColor(Component c)protected intgetFocusWidth(Component c)Returns the (unscaled) thickness of the outer focus border.protected floatgetInnerFocusWidth(Component c)Returns the (unscaled) thickness of the inner focus border.protected booleanisFocused(Component c)voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)protected voidpaintToolBarFocus(Component c, Graphics g, int x, int y, int width, int height)-
Methods inherited from class com.formdev.flatlaf.ui.FlatBorder
getLineWidth, getOutlineColor, isCellEditor, isEnabled
-
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
-
-
-
-
Field Detail
-
borderColor
protected final Color borderColor
-
endBorderColor
protected final Color endBorderColor
-
disabledBorderColor
protected final Color disabledBorderColor
-
focusedBorderColor
protected final Color focusedBorderColor
-
hoverBorderColor
protected final Color hoverBorderColor
-
defaultBorderColor
protected final Color defaultBorderColor
-
defaultEndBorderColor
protected final Color defaultEndBorderColor
-
defaultHoverBorderColor
protected final Color defaultHoverBorderColor
-
defaultFocusedBorderColor
protected final Color defaultFocusedBorderColor
-
defaultFocusColor
protected final Color defaultFocusColor
-
toolbarFocusColor
protected final Color toolbarFocusColor
- Since:
- 1.4
-
borderWidth
protected final int borderWidth
-
defaultBorderWidth
protected final int defaultBorderWidth
-
buttonInnerFocusWidth
protected final float buttonInnerFocusWidth
-
toolbarMargin
protected final Insets toolbarMargin
-
toolbarSpacingInsets
protected final Insets toolbarSpacingInsets
-
toolbarFocusWidth
protected final float toolbarFocusWidth
- Since:
- 1.4
-
arc
protected final int arc
-
-
Method Detail
-
paintBorder
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
- Specified by:
paintBorderin interfaceBorder- Overrides:
paintBorderin classFlatBorder
-
paintToolBarFocus
protected void paintToolBarFocus(Component c, Graphics g, int x, int y, int width, int height)
- Since:
- 1.4
-
getFocusColor
protected Color getFocusColor(Component c)
- Overrides:
getFocusColorin classFlatBorder
-
isFocused
protected boolean isFocused(Component c)
- Overrides:
isFocusedin classFlatBorder
-
getBorderColor
protected Paint getBorderColor(Component c)
- Overrides:
getBorderColorin classFlatBorder
-
getBorderInsets
public Insets getBorderInsets(Component c, Insets insets)
- Overrides:
getBorderInsetsin classFlatBorder
-
getFocusWidth
protected int getFocusWidth(Component c)
Description copied from class:FlatBorderReturns the (unscaled) thickness of the outer focus border.- Overrides:
getFocusWidthin classFlatBorder
-
getInnerFocusWidth
protected float getInnerFocusWidth(Component c)
Description copied from class:FlatBorderReturns the (unscaled) thickness of the inner focus border.- Overrides:
getInnerFocusWidthin classFlatBorder
-
getBorderWidth
protected int getBorderWidth(Component c)
Description copied from class:FlatBorderReturns the (unscaled) line thickness used to paint the border. This may be different toFlatBorder.getLineWidth(java.awt.Component).- Overrides:
getBorderWidthin classFlatBorder
-
getArc
protected int getArc(Component c)
Description copied from class:FlatBorderReturns the (unscaled) arc diameter of the border.- Overrides:
getArcin classFlatBorder
-
-