Package com.formdev.flatlaf.ui
Class FlatListCellBorder
- 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
-
- com.formdev.flatlaf.ui.FlatListCellBorder
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.border.Border
,javax.swing.plaf.UIResource
- Direct Known Subclasses:
FlatListCellBorder.Default
,FlatListCellBorder.Focused
,FlatListCellBorder.Selected
public class FlatListCellBorder extends FlatLineBorder
Cell border forDefaultListCellRenderer
(used byJList
).Uses separate cell margins from UI defaults to allow easy customizing.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlatListCellBorder.Default
Border for unselected cell that uses margins, but does not paint focus indicator border.static class
FlatListCellBorder.Focused
Border for focused unselected cell that uses margins and paints focus indicator border.static class
FlatListCellBorder.Selected
Border for selected cell that uses margins and paints focus indicator border if enabled (List.showCellFocusIndicator=true) and multiple items are selected.
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Component
c
protected boolean
showCellFocusIndicator
-
Constructor Summary
Constructors Modifier Constructor Description protected
FlatListCellBorder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Insets
getBorderInsets(java.awt.Component c, java.awt.Insets insets)
java.awt.Color
getLineColor()
(package private) static <T> T
getStyleFromListUI(java.awt.Component c, java.util.function.Function<FlatListUI,T> f)
Because this border is always shared for all lists, get border specific style from FlatListUI.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.FlatLineBorder
getArc, getLineThickness
-
Methods inherited from class com.formdev.flatlaf.ui.FlatEmptyBorder
applyStyleProperty, getBorderInsets, getStyleableValue, getUnscaledBorderInsets, scaleInsets
-
-
-
-
Method Detail
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
- Overrides:
getBorderInsets
in classFlatEmptyBorder
-
getLineColor
public java.awt.Color getLineColor()
- Overrides:
getLineColor
in classFlatLineBorder
-
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 classFlatLineBorder
-
getStyleFromListUI
static <T> T getStyleFromListUI(java.awt.Component c, java.util.function.Function<FlatListUI,T> f)
Because this border is always shared for all lists, get border specific style from FlatListUI.
-
-