Package com.formdev.flatlaf.icons
Class FlatCheckBoxIcon
- java.lang.Object
-
- com.formdev.flatlaf.icons.FlatAbstractIcon
-
- com.formdev.flatlaf.icons.FlatCheckBoxIcon
-
- All Implemented Interfaces:
Icon,UIResource
- Direct Known Subclasses:
FlatRadioButtonIcon
public class FlatCheckBoxIcon extends FlatAbstractIcon
Icon forJCheckBox.Note: If Component.focusWidth is greater than zero, then the outer focus border is painted outside of the icon bounds. Make sure that the checkbox has margins, which are equal or greater than focusWidth.
- UiDefault:
- CheckBox.icon.style String optional; "outlined"/null (default) or "filled", Component.focusWidth int, Component.borderWidth int, Component.focusColor Color, CheckBox.icon.focusWidth int or float optional; defaults to Component.focusWidth, CheckBox.icon.borderWidth int or float optional; defaults to Component.borderWidth, CheckBox.icon.selectedBorderWidth int or float optional; defaults to CheckBox.icon.borderWidth, CheckBox.icon.disabledSelectedBorderWidth int or float optional; defaults to CheckBox.icon.selectedBorderWidth, CheckBox.icon.indeterminateBorderWidth int or float optional; defaults to CheckBox.icon.selectedBorderWidth, CheckBox.icon.disabledIndeterminateBorderWidth int or float optional; defaults to CheckBox.icon.disabledSelectedBorderWidth, CheckBox.arc int, CheckBox.icon.focusColor Color optional; defaults to Component.focusColor, CheckBox.icon.borderColor Color, CheckBox.icon.background Color, CheckBox.icon.selectedBorderColor Color, CheckBox.icon.selectedBackground Color, CheckBox.icon.checkmarkColor Color, CheckBox.icon.indeterminateBorderColor Color optional; defaults to CheckBox.icon.selectedBorderColor, CheckBox.icon.indeterminateBackground Color optional; defaults to CheckBox.icon.selectedBackground, CheckBox.icon.indeterminateCheckmarkColor Color optional; defaults to CheckBox.icon.checkmarkColor, CheckBox.icon.disabledBorderColor Color, CheckBox.icon.disabledBackground Color, CheckBox.icon.disabledSelectedBorderColor Color optional; defaults to CheckBox.icon.disabledBorderColor, CheckBox.icon.disabledSelectedBackground Color optional; defaults to CheckBox.icon.disabledBackground, CheckBox.icon.disabledCheckmarkColor Color, CheckBox.icon.disabledIndeterminateBorderColor Color optional; defaults to CheckBox.icon.disabledSelectedBorderColor, CheckBox.icon.disabledIndeterminateBackground Color optional; defaults to CheckBox.icon.disabledSelectedBackground, CheckBox.icon.disabledIndeterminateCheckmarkColor Color optional; defaults to CheckBox.icon.disabledCheckmarkColor, CheckBox.icon.focusedBorderColor Color optional, CheckBox.icon.focusedBackground Color optional, CheckBox.icon.focusedSelectedBorderColor Color optional; defaults to CheckBox.icon.focusedBorderColor, CheckBox.icon.focusedSelectedBackground Color optional; defaults to CheckBox.icon.focusedBackground, CheckBox.icon.focusedCheckmarkColor Color optional; defaults to CheckBox.icon.checkmarkColor, CheckBox.icon.focusedIndeterminateBorderColor Color optional; defaults to CheckBox.icon.focusedSelectedBorderColor, CheckBox.icon.focusedIndeterminateBackground Color optional; defaults to CheckBox.icon.focusedSelectedBackground, CheckBox.icon.focusedIndeterminateCheckmarkColor Color optional; defaults to CheckBox.icon.focusedCheckmarkColor, CheckBox.icon.hoverBorderColor Color optional, CheckBox.icon.hoverBackground Color optional, CheckBox.icon.hoverSelectedBorderColor Color optional; defaults to CheckBox.icon.hoverBorderColor, CheckBox.icon.hoverSelectedBackground Color optional; defaults to CheckBox.icon.hoverBackground, CheckBox.icon.hoverCheckmarkColor Color optional; defaults to CheckBox.icon.checkmarkColor, CheckBox.icon.hoverIndeterminateBorderColor Color optional; defaults to CheckBox.icon.hoverSelectedBorderColor, CheckBox.icon.hoverIndeterminateBackground Color optional; defaults to CheckBox.icon.hoverSelectedBackground, CheckBox.icon.hoverIndeterminateCheckmarkColor Color optional; defaults to CheckBox.icon.hoverCheckmarkColor, CheckBox.icon.pressedBorderColor Color optional, CheckBox.icon.pressedBackground Color optional, CheckBox.icon.pressedSelectedBorderColor Color optional; defaults to CheckBox.icon.pressedBorderColor, CheckBox.icon.pressedSelectedBackground Color optional; defaults to CheckBox.icon.pressedBackground, CheckBox.icon.pressedCheckmarkColor Color optional; defaults to CheckBox.icon.checkmarkColor, CheckBox.icon.pressedIndeterminateBorderColor Color optional; defaults to CheckBox.icon.pressedSelectedBorderColor, CheckBox.icon.pressedIndeterminateBackground Color optional; defaults to CheckBox.icon.pressedSelectedBackground, CheckBox.icon.pressedIndeterminateCheckmarkColor Color optional; defaults to CheckBox.icon.pressedCheckmarkColor
-
-
Field Summary
-
Fields inherited from class com.formdev.flatlaf.icons.FlatAbstractIcon
color, height, width
-
-
Constructor Summary
Constructors Constructor Description FlatCheckBoxIcon()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectapplyStyleProperty(String key, Object value)protected ColorgetBackground(Component c, boolean selected, boolean indeterminate)protected ColorgetBorderColor(Component c, boolean selected, boolean indeterminate)protected ColorgetCheckmarkColor(Component c, boolean indeterminate)protected ColorgetFocusColor(Component c)floatgetFocusWidth()protected StringgetPropertyPrefix()Map<String,Class<?>>getStyleableInfos()ObjectgetStyleableValue(String key)protected static ColorgetUIColor(String key, String style)protected static floatgetUIFloat(String key, float defaultValue, String style)protected booleanisIndeterminate(Component c)protected booleanisSelected(Component c)protected voidpaintBackground(Component c, Graphics2D g, float borderWidth)protected voidpaintBorder(Component c, Graphics2D g, float borderWidth)protected voidpaintCheckmark(Component c, Graphics2D g)protected voidpaintFocusBorder(Component c, Graphics2D g)protected voidpaintIcon(Component c, Graphics2D g)protected voidpaintIndeterminate(Component c, Graphics2D g)-
Methods inherited from class com.formdev.flatlaf.icons.FlatAbstractIcon
getIconHeight, getIconWidth, paintBackground, paintIcon
-
-
-
-
Field Detail
-
style
protected final String style
-
focusWidth
protected float focusWidth
-
focusColor
protected Color focusColor
-
borderWidth
protected float borderWidth
- Since:
- 2
-
selectedBorderWidth
protected float selectedBorderWidth
- Since:
- 2
-
disabledSelectedBorderWidth
protected float disabledSelectedBorderWidth
- Since:
- 2
-
indeterminateBorderWidth
protected float indeterminateBorderWidth
- Since:
- 3.6
-
disabledIndeterminateBorderWidth
protected float disabledIndeterminateBorderWidth
- Since:
- 3.6
-
arc
protected int arc
-
borderColor
protected Color borderColor
-
background
protected Color background
-
selectedBorderColor
protected Color selectedBorderColor
-
selectedBackground
protected Color selectedBackground
-
checkmarkColor
protected Color checkmarkColor
-
indeterminateBorderColor
protected Color indeterminateBorderColor
- Since:
- 3.6
-
indeterminateBackground
protected Color indeterminateBackground
- Since:
- 3.6
-
indeterminateCheckmarkColor
protected Color indeterminateCheckmarkColor
- Since:
- 3.6
-
disabledBorderColor
protected Color disabledBorderColor
-
disabledBackground
protected Color disabledBackground
-
disabledSelectedBorderColor
protected Color disabledSelectedBorderColor
- Since:
- 2
-
disabledSelectedBackground
protected Color disabledSelectedBackground
- Since:
- 2
-
disabledCheckmarkColor
protected Color disabledCheckmarkColor
-
disabledIndeterminateBorderColor
protected Color disabledIndeterminateBorderColor
- Since:
- 3.6
-
disabledIndeterminateBackground
protected Color disabledIndeterminateBackground
- Since:
- 3.6
-
disabledIndeterminateCheckmarkColor
protected Color disabledIndeterminateCheckmarkColor
- Since:
- 3.6
-
focusedBorderColor
protected Color focusedBorderColor
-
focusedBackground
protected Color focusedBackground
-
focusedSelectedBorderColor
protected Color focusedSelectedBorderColor
- Since:
- 2
-
focusedSelectedBackground
protected Color focusedSelectedBackground
- Since:
- 2
-
focusedCheckmarkColor
protected Color focusedCheckmarkColor
- Since:
- 2
-
focusedIndeterminateBorderColor
protected Color focusedIndeterminateBorderColor
- Since:
- 3.6
-
focusedIndeterminateBackground
protected Color focusedIndeterminateBackground
- Since:
- 3.6
-
focusedIndeterminateCheckmarkColor
protected Color focusedIndeterminateCheckmarkColor
- Since:
- 3.6
-
hoverBorderColor
protected Color hoverBorderColor
-
hoverBackground
protected Color hoverBackground
-
hoverSelectedBorderColor
protected Color hoverSelectedBorderColor
- Since:
- 2
-
hoverSelectedBackground
protected Color hoverSelectedBackground
- Since:
- 2
-
hoverCheckmarkColor
protected Color hoverCheckmarkColor
- Since:
- 2
-
hoverIndeterminateBorderColor
protected Color hoverIndeterminateBorderColor
- Since:
- 3.6
-
hoverIndeterminateBackground
protected Color hoverIndeterminateBackground
- Since:
- 3.6
-
hoverIndeterminateCheckmarkColor
protected Color hoverIndeterminateCheckmarkColor
- Since:
- 3.6
-
pressedBorderColor
protected Color pressedBorderColor
- Since:
- 2
-
pressedBackground
protected Color pressedBackground
-
pressedSelectedBorderColor
protected Color pressedSelectedBorderColor
- Since:
- 2
-
pressedSelectedBackground
protected Color pressedSelectedBackground
- Since:
- 2
-
pressedCheckmarkColor
protected Color pressedCheckmarkColor
- Since:
- 2
-
pressedIndeterminateBorderColor
protected Color pressedIndeterminateBorderColor
- Since:
- 3.6
-
pressedIndeterminateBackground
protected Color pressedIndeterminateBackground
- Since:
- 3.6
-
pressedIndeterminateCheckmarkColor
protected Color pressedIndeterminateCheckmarkColor
- Since:
- 3.6
-
-
Method Detail
-
getPropertyPrefix
protected String getPropertyPrefix()
-
getUIFloat
protected static float getUIFloat(String key, float defaultValue, String style)
- Since:
- 2
-
paintIcon
protected void paintIcon(Component c, Graphics2D g)
- Specified by:
paintIconin classFlatAbstractIcon
-
paintFocusBorder
protected void paintFocusBorder(Component c, Graphics2D g)
-
paintBorder
protected void paintBorder(Component c, Graphics2D g, float borderWidth)
-
paintBackground
protected void paintBackground(Component c, Graphics2D g, float borderWidth)
-
paintCheckmark
protected void paintCheckmark(Component c, Graphics2D g)
-
paintIndeterminate
protected void paintIndeterminate(Component c, Graphics2D g)
-
isIndeterminate
protected boolean isIndeterminate(Component c)
-
isSelected
protected boolean isSelected(Component c)
-
getFocusWidth
public float getFocusWidth()
- Since:
- 2
-
getBorderColor
protected Color getBorderColor(Component c, boolean selected, boolean indeterminate)
- Since:
- 3.6
-
getBackground
protected Color getBackground(Component c, boolean selected, boolean indeterminate)
- Since:
- 3.6
-
-