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:
java.io.Serializable
,javax.swing.border.Border
,javax.swing.plaf.UIResource
- Direct Known Subclasses:
FlatListCellBorder
,FlatPopupMenuBorder
,FlatTableCellBorder
public class FlatLineBorder extends FlatEmptyBorder
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
andJLabel
, this border can be used paint rounded background (if line color isnull
) or paint rounded line border with rounded background.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int
arc
private java.awt.Color
lineColor
private float
lineThickness
-
Constructor Summary
Constructors Constructor Description FlatLineBorder(java.awt.Insets insets, int arc)
FlatLineBorder(java.awt.Insets insets, java.awt.Color lineColor)
FlatLineBorder(java.awt.Insets insets, java.awt.Color lineColor, float lineThickness, int arc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getArc()
Returns the (unscaled) arc diameter of the border corners.java.awt.Color
getLineColor()
float
getLineThickness()
Returns the (unscaled) line thickness used to paint the border.void
paintBorder(java.awt.Component c, java.awt.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
-
-
-
-
Constructor Detail
-
FlatLineBorder
public FlatLineBorder(java.awt.Insets insets, java.awt.Color lineColor)
-
FlatLineBorder
public FlatLineBorder(java.awt.Insets insets, java.awt.Color lineColor, float lineThickness, int arc)
- Since:
- 2
-
FlatLineBorder
public FlatLineBorder(java.awt.Insets insets, int arc)
- Since:
- 3.5
-
-
Method Detail
-
getLineColor
public java.awt.Color 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
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
- Specified by:
paintBorder
in interfacejavax.swing.border.Border
- Overrides:
paintBorder
in classjavax.swing.border.EmptyBorder
-
-