Class FlatBorder
java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.plaf.basic.BasicBorders.MarginBorder
com.formdev.flatlaf.ui.FlatBorder
- All Implemented Interfaces:
FlatStylingSupport.StyleableObject, Serializable, Border, UIResource
- Direct Known Subclasses:
FlatButtonBorder, FlatRoundBorder, FlatScrollPaneBorder, FlatTextBorder
public class FlatBorder
extends BasicBorders.MarginBorder
implements FlatStylingSupport.StyleableObject
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:
- UiDefault:
- Component.focusWidth int, Component.innerFocusWidth int or float, Component.innerOutlineWidth int or float, Component.borderWidth int or float, Component.focusColor Color, Component.borderColor Color, Component.disabledBorderColor Color, Component.focusedBorderColor Color, Component.error.borderColor Color, Component.error.focusedBorderColor Color, Component.warning.borderColor Color, Component.warning.focusedBorderColor Color, Component.success.borderColor Color, Component.success.focusedBorderColor Color, Component.custom.borderColor Color
-
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 TypeMethodDescriptionprotected 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.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, isBorderOpaqueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FlatStylingSupport.StyleableObject
applyStyleProperty, getStyleableInfos, getStyleableValue
-
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
-
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.
-