Package com.formdev.flatlaf.ui
Class FlatComboBoxUI.CellPaddingBorder
- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- com.formdev.flatlaf.ui.FlatComboBoxUI.CellPaddingBorder
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.border.Border
- Enclosing class:
- FlatComboBoxUI
private static class FlatComboBoxUI.CellPaddingBorder extends javax.swing.border.AbstractBorder
Cell padding border used in popup list and for current value if not editable.The insets are the union of the cell padding and the renderer border insets, which vertically aligns text in popup list with text in combobox.
The renderer border is painted on the outer side of this border.
For button style "mac", also used to increase insets on left side for "checked item" icon and to paint "checked item" icon for selected combobox item.
-
-
Field Summary
Fields Modifier and Type Field Description private int
focusWidth
(package private) static java.lang.String
KEY_MAC_STYLE_HINT
(package private) static int
MAC_STYLE_GAP
private java.awt.Insets
padding
private javax.swing.border.Border
rendererBorder
private javax.swing.JComponent
rendererComponent
-
Constructor Summary
Constructors Constructor Description CellPaddingBorder(java.awt.Insets padding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Insets
getBorderInsets(java.awt.Component c, java.awt.Insets insets)
(package private) void
install(java.awt.Component c, int focusWidth)
void
paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
(package private) void
uninstall()
Uninstall border from previously installed component.
-
-
-
Field Detail
-
KEY_MAC_STYLE_HINT
static final java.lang.String KEY_MAC_STYLE_HINT
- See Also:
- Constant Field Values
-
MAC_STYLE_GAP
static final int MAC_STYLE_GAP
- See Also:
- Constant Field Values
-
padding
private java.awt.Insets padding
-
rendererComponent
private javax.swing.JComponent rendererComponent
-
rendererBorder
private javax.swing.border.Border rendererBorder
-
focusWidth
private int focusWidth
-
-
Method Detail
-
install
void install(java.awt.Component c, int focusWidth)
-
uninstall
void uninstall()
Uninstall border from previously installed component. Because this border is installed in PopupListCellRenderer.getListCellRendererComponent(), there is no single place to uninstall it. This is the reason why this method is called from various places.
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
- Overrides:
getBorderInsets
in classjavax.swing.border.AbstractBorder
-
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.AbstractBorder
-
-