Package com.formdev.flatlaf.ui
Class FlatLineBorder
java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.EmptyBorder
javax.swing.plaf.BorderUIResource.EmptyBorderUIResource
com.formdev.flatlaf.ui.FlatEmptyBorder
com.formdev.flatlaf.ui.FlatLineBorder
- All Implemented Interfaces:
Serializable
,Border
,UIResource
- Direct Known Subclasses:
FlatListCellBorder
,FlatPopupMenuBorder
,FlatTableCellBorder
Line border for various components.
Paints a scaled (usually 1px thick) line around the component. The line thickness is not added to the border insets. The insets should be at least have line thickness (usually 1,1,1,1).
For JPanel
and JLabel
, this border
can be used paint rounded background (if line color is null
) or
paint rounded line border with rounded background.
- See Also:
-
Field Summary
FieldsFields inherited from class javax.swing.border.EmptyBorder
bottom, left, right, top
-
Constructor Summary
ConstructorsConstructorDescriptionFlatLineBorder
(Insets insets, int arc) FlatLineBorder
(Insets insets, Color lineColor) FlatLineBorder
(Insets insets, Color lineColor, float lineThickness, int arc) -
Method Summary
Modifier and TypeMethodDescriptionint
getArc()
Returns the (unscaled) arc diameter of the border corners.float
Returns the (unscaled) line thickness used to paint the border.void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) Methods inherited from class com.formdev.flatlaf.ui.FlatEmptyBorder
applyStyleProperty, getBorderInsets, getBorderInsets, getStyleableValue, getUnscaledBorderInsets, scaleInsets
Methods inherited from class javax.swing.border.EmptyBorder
isBorderOpaque
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
Field Details
-
lineColor
-
lineThickness
private final float lineThickness -
arc
private final int arc- Since:
- 2
-
-
Constructor Details
-
FlatLineBorder
-
FlatLineBorder
- Since:
- 2
-
FlatLineBorder
- Since:
- 3.5
-
-
Method Details
-
getLineColor
-
getLineThickness
public float getLineThickness()Returns the (unscaled) line thickness used to paint the border. The line thickness does not affect the border insets. -
getArc
public int getArc()Returns the (unscaled) arc diameter of the border corners.- Since:
- 2
-
paintBorder
- Specified by:
paintBorder
in interfaceBorder
- Overrides:
paintBorder
in classEmptyBorder
-