Package com.formdev.flatlaf.ui
Class FlatRadioButtonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.basic.BasicButtonUI
-
- javax.swing.plaf.basic.BasicToggleButtonUI
-
- javax.swing.plaf.basic.BasicRadioButtonUI
-
- com.formdev.flatlaf.ui.FlatRadioButtonUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI
- Direct Known Subclasses:
FlatCheckBoxUI
public class FlatRadioButtonUI extends javax.swing.plaf.basic.BasicRadioButtonUI implements FlatStylingSupport.StyleableUI
Provides the Flat LaF UI delegate forJRadioButton
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
FlatRadioButtonUI.AWTPeerMouseExitedFix
Hack for missing mouse-exited event for java.awt.Checkbox on macOS (to fix hover effect).protected class
FlatRadioButtonUI.FlatRadioButtonListener
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Color
defaultBackground
private boolean
defaults_initialized
protected java.awt.Color
disabledText
private boolean
iconShared
protected int
iconTextGap
private java.util.Map<java.lang.String,java.lang.Object>
oldStyleValues
private boolean
shared
private static java.awt.Insets
tempInsets
-
Constructor Summary
Constructors Modifier Constructor Description protected
FlatRadioButtonUI(boolean shared)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyStyle(javax.swing.AbstractButton b, java.lang.Object style)
protected java.lang.Object
applyStyleProperty(javax.swing.AbstractButton b, java.lang.String key, java.lang.Object value)
protected javax.swing.plaf.basic.BasicButtonListener
createButtonListener(javax.swing.AbstractButton b)
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent c)
int
getBaseline(javax.swing.JComponent c, int width, int height)
private java.awt.Color
getDefaultBackground(javax.swing.JComponent c)
Returns the default background color of the component.private int
getIconFocusWidth(javax.swing.JComponent c)
java.awt.Dimension
getPreferredSize(javax.swing.JComponent c)
java.util.Map<java.lang.String,java.lang.Class<?>>
getStyleableInfos(javax.swing.JComponent c)
java.lang.Object
getStyleableValue(javax.swing.JComponent c, java.lang.String key)
(package private) java.lang.String
getStyleType()
void
installDefaults(javax.swing.AbstractButton b)
protected void
installStyle(javax.swing.AbstractButton b)
void
installUI(javax.swing.JComponent c)
private void
installUIImpl(javax.swing.JComponent c)
void
paint(java.awt.Graphics g, javax.swing.JComponent c)
protected void
paintText(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text)
protected void
propertyChange(javax.swing.AbstractButton b, java.beans.PropertyChangeEvent e)
protected void
uninstallDefaults(javax.swing.AbstractButton b)
void
uninstallUI(javax.swing.JComponent c)
-
Methods inherited from class javax.swing.plaf.basic.BasicRadioButtonUI
getDefaultIcon, getPropertyPrefix, paintFocus
-
Methods inherited from class javax.swing.plaf.basic.BasicToggleButtonUI
getTextShiftOffset, paintIcon
-
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, installKeyboardActions, installListeners, paintButtonPressed, paintFocus, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners
-
-
-
-
Field Detail
-
iconTextGap
protected int iconTextGap
-
disabledText
protected java.awt.Color disabledText
-
defaultBackground
private java.awt.Color defaultBackground
-
shared
private final boolean shared
-
iconShared
private boolean iconShared
-
defaults_initialized
private boolean defaults_initialized
-
oldStyleValues
private java.util.Map<java.lang.String,java.lang.Object> oldStyleValues
-
tempInsets
private static final java.awt.Insets tempInsets
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUI
in classjavax.swing.plaf.basic.BasicButtonUI
-
installUIImpl
private void installUIImpl(javax.swing.JComponent c)
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUI
in classjavax.swing.plaf.basic.BasicButtonUI
-
installDefaults
public void installDefaults(javax.swing.AbstractButton b)
- Overrides:
installDefaults
in classjavax.swing.plaf.basic.BasicRadioButtonUI
-
uninstallDefaults
protected void uninstallDefaults(javax.swing.AbstractButton b)
- Overrides:
uninstallDefaults
in classjavax.swing.plaf.basic.BasicRadioButtonUI
-
createButtonListener
protected javax.swing.plaf.basic.BasicButtonListener createButtonListener(javax.swing.AbstractButton b)
- Overrides:
createButtonListener
in classjavax.swing.plaf.basic.BasicButtonUI
-
propertyChange
protected void propertyChange(javax.swing.AbstractButton b, java.beans.PropertyChangeEvent e)
- Since:
- 2
-
installStyle
protected void installStyle(javax.swing.AbstractButton b)
- Since:
- 2
-
getStyleType
java.lang.String getStyleType()
- Since:
- 2
-
applyStyle
protected void applyStyle(javax.swing.AbstractButton b, java.lang.Object style)
- Since:
- 2
-
applyStyleProperty
protected java.lang.Object applyStyleProperty(javax.swing.AbstractButton b, java.lang.String key, java.lang.Object value)
- Since:
- 2
-
getStyleableInfos
public java.util.Map<java.lang.String,java.lang.Class<?>> getStyleableInfos(javax.swing.JComponent c)
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2
-
getStyleableValue
public java.lang.Object getStyleableValue(javax.swing.JComponent c, java.lang.String key)
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2.5
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSize
in classjavax.swing.plaf.basic.BasicRadioButtonUI
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
paint
in classjavax.swing.plaf.basic.BasicRadioButtonUI
-
paintText
protected void paintText(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text)
- Overrides:
paintText
in classjavax.swing.plaf.basic.BasicButtonUI
-
getDefaultBackground
private java.awt.Color getDefaultBackground(javax.swing.JComponent c)
Returns the default background color of the component. If the component is used as cell renderer (e.g. in JTable), then the background color of the renderer container is returned.
-
getIconFocusWidth
private int getIconFocusWidth(javax.swing.JComponent c)
-
getBaseline
public int getBaseline(javax.swing.JComponent c, int width, int height)
- Overrides:
getBaseline
in classjavax.swing.plaf.basic.BasicButtonUI
-
-