ch.randelshofer.quaqua
Class QuaquaRadioButtonUI
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
ch.randelshofer.quaqua.QuaquaRadioButtonUI
- All Implemented Interfaces:
- VisuallyLayoutable
public class QuaquaRadioButtonUI
- extends javax.swing.plaf.basic.BasicRadioButtonUI
- implements VisuallyLayoutable
QuaquaRadioButtonUI.
- Version:
- $Id: QuaquaRadioButtonUI.java 361 2010-11-21 11:19:20Z wrandelshofer $
- Author:
- Werner Randelshofer
Field Summary |
protected javax.swing.Icon |
smallIcon
|
Fields inherited from class javax.swing.plaf.basic.BasicRadioButtonUI |
icon |
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI |
defaultTextIconGap, defaultTextShiftOffset |
Method Summary |
protected javax.swing.plaf.basic.BasicButtonListener |
createButtonListener(javax.swing.AbstractButton b)
|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent b)
|
int |
getBaseline(javax.swing.JComponent c,
int width,
int height)
Returns the baseline for the specified component, or -1 if the
baseline can not be determined. |
javax.swing.Icon |
getDefaultIcon(javax.swing.JComponent c)
|
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c)
The preferred size of the radio button |
java.awt.Rectangle |
getVisualBounds(javax.swing.JComponent c,
int type,
int width,
int height)
Returns the visual bounds for the specified component, or null if the
visual bounds can not be determined. |
protected void |
installDefaults(javax.swing.AbstractButton b)
|
protected void |
installListeners(javax.swing.AbstractButton b)
|
protected java.lang.String |
layoutCL(javax.swing.AbstractButton c,
java.awt.FontMetrics fontMetrics,
java.lang.String text,
javax.swing.Icon icon,
java.awt.Rectangle viewR,
java.awt.Rectangle iconR,
java.awt.Rectangle textR)
Forwards the call to SwingUtilities.layoutCompoundLabel(). |
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
|
protected void |
paintFocus(java.awt.Graphics g,
java.awt.Rectangle textR,
java.awt.Dimension size)
|
protected void |
paintText(java.awt.Graphics g,
javax.swing.AbstractButton b,
java.awt.Rectangle textR,
java.lang.String text)
Method which renders the text of the current button. |
protected void |
uninstallDefaults(javax.swing.AbstractButton b)
|
protected void |
uninstallListeners(javax.swing.AbstractButton b)
|
static void |
updateFocusableState(javax.swing.AbstractButton button)
|
Methods inherited from class javax.swing.plaf.basic.BasicRadioButtonUI |
getDefaultIcon, getPropertyPrefix |
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, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallUI |
Methods inherited from class javax.swing.plaf.ComponentUI |
contains, getAccessibleChild, getAccessibleChildrenCount, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
smallIcon
protected javax.swing.Icon smallIcon
QuaquaRadioButtonUI
public QuaquaRadioButtonUI()
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)
installDefaults
protected void installDefaults(javax.swing.AbstractButton b)
- Overrides:
installDefaults
in class javax.swing.plaf.basic.BasicRadioButtonUI
uninstallDefaults
protected void uninstallDefaults(javax.swing.AbstractButton b)
- Overrides:
uninstallDefaults
in class javax.swing.plaf.basic.BasicRadioButtonUI
installListeners
protected void installListeners(javax.swing.AbstractButton b)
- Overrides:
installListeners
in class javax.swing.plaf.basic.BasicButtonUI
uninstallListeners
protected void uninstallListeners(javax.swing.AbstractButton b)
- Overrides:
uninstallListeners
in class javax.swing.plaf.basic.BasicButtonUI
getDefaultIcon
public javax.swing.Icon getDefaultIcon(javax.swing.JComponent c)
createButtonListener
protected javax.swing.plaf.basic.BasicButtonListener createButtonListener(javax.swing.AbstractButton b)
- Overrides:
createButtonListener
in class javax.swing.plaf.basic.BasicButtonUI
paint
public void paint(java.awt.Graphics g,
javax.swing.JComponent c)
- Overrides:
paint
in class javax.swing.plaf.basic.BasicRadioButtonUI
paintFocus
protected void paintFocus(java.awt.Graphics g,
java.awt.Rectangle textR,
java.awt.Dimension size)
- Overrides:
paintFocus
in class javax.swing.plaf.basic.BasicRadioButtonUI
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- The preferred size of the radio button
- Overrides:
getPreferredSize
in class javax.swing.plaf.basic.BasicRadioButtonUI
paintText
protected void paintText(java.awt.Graphics g,
javax.swing.AbstractButton b,
java.awt.Rectangle textR,
java.lang.String text)
- Method which renders the text of the current button.
- Overrides:
paintText
in class javax.swing.plaf.basic.BasicButtonUI
- Parameters:
g
- Graphics contextb
- Current button to rendertextR
- Bounding rectangle to render the text.text
- String to render- Since:
- 1.4
layoutCL
protected java.lang.String layoutCL(javax.swing.AbstractButton c,
java.awt.FontMetrics fontMetrics,
java.lang.String text,
javax.swing.Icon icon,
java.awt.Rectangle viewR,
java.awt.Rectangle iconR,
java.awt.Rectangle textR)
- Forwards the call to SwingUtilities.layoutCompoundLabel().
This method is here so that a subclass could do Label specific
layout and to shorten the method name a little.
- See Also:
SwingUtilities.layoutCompoundLabel(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int)
getBaseline
public int getBaseline(javax.swing.JComponent c,
int width,
int height)
- Description copied from interface:
VisuallyLayoutable
- Returns the baseline for the specified component, or -1 if the
baseline can not be determined. The baseline is measured from
the top of the component.
- Specified by:
getBaseline
in interface VisuallyLayoutable
- Overrides:
getBaseline
in class javax.swing.plaf.basic.BasicButtonUI
- Parameters:
c
- JComponent to calculate baseline forwidth
- Width of the component to determine baseline for.height
- Height of the component to determine baseline for.
- Returns:
- baseline for the specified component
getVisualBounds
public java.awt.Rectangle getVisualBounds(javax.swing.JComponent c,
int type,
int width,
int height)
- Description copied from interface:
VisuallyLayoutable
- Returns the visual bounds for the specified component, or null if the
visual bounds can not be determined.
- Specified by:
getVisualBounds
in interface VisuallyLayoutable
- Parameters:
c
- JComponent to calculate visual margin fortype
- The type of the visual margin.width
- Width of the componentheight
- Height of the component
- Returns:
- The visual bounds in component coordinates.
updateFocusableState
public static void updateFocusableState(javax.swing.AbstractButton button)