Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua
Class QuaquaRadioButtonUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ButtonUI
          extended by javax.swing.plaf.basic.BasicButtonUI
              extended by javax.swing.plaf.basic.BasicToggleButtonUI
                  extended by javax.swing.plaf.basic.BasicRadioButtonUI
                      extended by 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

Nested Class Summary
static class QuaquaRadioButtonUI.PropertyChangeHandler
          This inner class is marked "public" due to a compiler bug.
 
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
 
Fields inherited from interface ch.randelshofer.quaqua.VisuallyLayoutable
CLIP_BOUNDS, COMPONENT_BOUNDS, TEXT_BOUNDS
 
Constructor Summary
QuaquaRadioButtonUI()
           
 
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
 

Field Detail

smallIcon

protected javax.swing.Icon smallIcon
Constructor Detail

QuaquaRadioButtonUI

public QuaquaRadioButtonUI()
Method Detail

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 context
b - Current button to render
textR - 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 for
width - 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 for
type - The type of the visual margin.
width - Width of the component
height - Height of the component
Returns:
The visual bounds in component coordinates.

updateFocusableState

public static void updateFocusableState(javax.swing.AbstractButton button)

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.