Package com.formdev.flatlaf.ui
Class FlatBorder
java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.plaf.basic.BasicBorders.MarginBorder
com.formdev.flatlaf.ui.FlatBorder
- All Implemented Interfaces:
FlatStylingSupport.StyleableBorder
,Serializable
,Border
,UIResource
- Direct Known Subclasses:
FlatButtonBorder
,FlatRoundBorder
,FlatScrollPaneBorder
,FlatTextBorder
public class FlatBorder
extends BasicBorders.MarginBorder
implements FlatStylingSupport.StyleableBorder
Border for various components (e.g.
JTextField
).
There is empty space around the component border, if Component.focusWidth is greater than zero, which is used to paint outer focus border.
Because there is empty space (if outer focus border is not painted),
UI delegates that use this border (or subclasses) must invoke
FlatUIUtils.paintParentBackground(java.awt.Graphics, javax.swing.JComponent)
to fill the empty space correctly.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyStyleProperty
(String key, Object value) protected int
Returns the (unscaled) arc diameter of the border corners.protected Paint
getBorderInsets
(Component c, Insets insets) protected float
Returns the (unscaled) line thickness used to paint the border.protected Color
protected int
Returns the (unscaled) thickness of the outer focus border.protected float
Returns the (unscaled) thickness of the inner focus border.protected int
Returns the (unscaled) line thickness used to compute the border insets.protected Color
Returns the outline color of the component border specified in client propertyFlatClientProperties.OUTLINE
.getStyleableValue
(String key) protected boolean
protected boolean
protected boolean
void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
-
Field Details
-
focusWidth
protected int focusWidth -
innerFocusWidth
protected float innerFocusWidth -
innerOutlineWidth
protected float innerOutlineWidth -
borderWidth
protected float borderWidth- Since:
- 2
-
focusColor
-
borderColor
-
disabledBorderColor
-
focusedBorderColor
-
errorBorderColor
-
errorFocusedBorderColor
-
warningBorderColor
-
warningFocusedBorderColor
-
customBorderColor
-
outline
- Since:
- 2
-
outlineColor
- Since:
- 2
-
outlineFocusedColor
- Since:
- 2
-
-
Constructor Details
-
FlatBorder
public FlatBorder()
-
-
Method Details
-
applyStyleProperty
- Specified by:
applyStyleProperty
in interfaceFlatStylingSupport.StyleableBorder
- Since:
- 2
-
getStyleableInfos
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableBorder
- Since:
- 2
-
getStyleableValue
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableBorder
- Since:
- 2.5
-
paintBorder
- Specified by:
paintBorder
in interfaceBorder
- Overrides:
paintBorder
in classAbstractBorder
-
getOutlineColor
Returns the outline color of the component border specified in client propertyFlatClientProperties.OUTLINE
. -
getFocusColor
-
getBorderColor
-
isEnabled
-
isFocused
-
isCellEditor
-
getBorderInsets
- Overrides:
getBorderInsets
in classBasicBorders.MarginBorder
-
getFocusWidth
Returns the (unscaled) thickness of the outer focus border. -
getInnerFocusWidth
Returns the (unscaled) thickness of the inner focus border. -
getLineWidth
Returns the (unscaled) line thickness used to compute the border insets. This may be different togetBorderWidth(java.awt.Component)
. -
getBorderWidth
Returns the (unscaled) line thickness used to paint the border. This may be different togetLineWidth(java.awt.Component)
. -
getArc
Returns the (unscaled) arc diameter of the border corners.
-