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
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
JPanelandJLabel, 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 inherited from class javax.swing.border.EmptyBorder
bottom, left, right, top
-
-
Constructor Summary
Constructors Constructor Description FlatLineBorder(Insets insets, int arc)FlatLineBorder(Insets insets, Color lineColor)FlatLineBorder(Insets insets, Color lineColor, float lineThickness, int arc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetArc()Returns the (unscaled) arc diameter of the border corners.ColorgetLineColor()floatgetLineThickness()Returns the (unscaled) line thickness used to paint the border.voidpaintBorder(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
-
-
-
-
Method Detail
-
getLineColor
public 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(Component c, Graphics g, int x, int y, int width, int height)
- Specified by:
paintBorderin interfaceBorder- Overrides:
paintBorderin classEmptyBorder
-
-