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(Graphics, JComponent) to fill the empty space correctly.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprotected floatprotected Colorprotected Colorprotected Colorprotected Colorprotected Colorprotected Colorprotected intprotected floatprotected floatprotected Stringprotected Colorprotected Colorprotected Colorprotected Colorprotected Colorprotected Color -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyStyleProperty(String key, Object value) protected intReturns the (unscaled) arc diameter of the border corners.protected PaintgetBorderInsets(Component c, Insets insets) protected floatReturns the (unscaled) line thickness used to paint the border.protected Colorprotected intReturns the (unscaled) thickness of the outer focus border.protected floatReturns the (unscaled) thickness of the inner focus border.protected intReturns the (unscaled) line thickness used to compute the border insets.protected ColorReturns the outline color of the component border specified in client propertyFlatClientProperties.OUTLINE.getStyleableValue(String key) protected booleanprotected booleanprotected booleanvoidpaintBorder(Component c, Graphics g, int x, int y, int width, int height) Methods inherited from class 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
-
successBorderColor
- Since:
- 3.6
-
successFocusedBorderColor
- Since:
- 3.6
-
customBorderColor
-
outline
- Since:
- 2
-
outlineColor
- Since:
- 2
-
outlineFocusedColor
- Since:
- 2
-
-
Constructor Details
-
FlatBorder
public FlatBorder()
-
-
Method Details
-
applyStyleProperty
- Specified by:
applyStylePropertyin interfaceFlatStylingSupport.StyleableBorder- Since:
- 2
-
getStyleableInfos
- Specified by:
getStyleableInfosin interfaceFlatStylingSupport.StyleableBorder- Since:
- 2
-
getStyleableValue
- Specified by:
getStyleableValuein interfaceFlatStylingSupport.StyleableBorder- Since:
- 2.5
-
paintBorder
- Specified by:
paintBorderin interfaceBorder- Overrides:
paintBorderin classAbstractBorder
-
getOutlineColor
Returns the outline color of the component border specified in client propertyFlatClientProperties.OUTLINE. -
getFocusColor
-
getBorderColor
-
isEnabled
-
isFocused
-
isCellEditor
-
getBorderInsets
- Overrides:
getBorderInsetsin 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(Component). -
getBorderWidth
Returns the (unscaled) line thickness used to paint the border. This may be different togetLineWidth(Component). -
getArc
Returns the (unscaled) arc diameter of the border corners.
-