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.AbstractBorderCell 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 intfocusWidth(package private) static java.lang.StringKEY_MAC_STYLE_HINT(package private) static intMAC_STYLE_GAPprivate java.awt.Insetspaddingprivate javax.swing.border.BorderrendererBorderprivate javax.swing.JComponentrendererComponent
-
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.InsetsgetBorderInsets(java.awt.Component c, java.awt.Insets insets)(package private) voidinstall(java.awt.Component c, int focusWidth)voidpaintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)(package private) voiduninstall()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:
getBorderInsetsin 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:
paintBorderin interfacejavax.swing.border.Border- Overrides:
paintBorderin classjavax.swing.border.AbstractBorder
-
-