javax.swing.plaf.basic
Class BasicToggleButtonUI

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
Direct Known Subclasses:
BasicRadioButtonUI, MetalToggleButtonUI

public class BasicToggleButtonUI
extends BasicButtonUI

A UI delegate for the JToggleButton component.


Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
 
Constructor Summary
BasicToggleButtonUI()
           
 
Method Summary
static ComponentUI createUI(JComponent component)
          Returns a UI delegate for the specified component.
protected  String getPropertyPrefix()
          Returns the prefix for entries in the UIManager defaults table ("ToggleButton."
 void paint(Graphics g, JComponent c)
          Paint the component, which is an AbstractButton, according to its current state.
protected  void paintIcon(Graphics g, AbstractButton b, Rectangle iconRect)
          Paints the icon for the toggle button.
 
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, createButtonListener, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getTextShiftOffset, installDefaults, installKeyboardActions, installListeners, installUI, paintButtonPressed, paintFocus, paintIcon, paintText, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, 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
 

Constructor Detail

BasicToggleButtonUI

public BasicToggleButtonUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent component)
Returns a UI delegate for the specified component.

Parameters:
component - the component (should be an instance of JToggleButton).
Returns:
An instance of BasicToggleButtonUI.

getPropertyPrefix

protected String getPropertyPrefix()
Returns the prefix for entries in the UIManager defaults table ("ToggleButton." in this case).

Overrides:
getPropertyPrefix in class BasicButtonUI
Returns:
"ToggleButton."

paint

public void paint(Graphics g,
                  JComponent c)
Paint the component, which is an AbstractButton, according to its current state.

Overrides:
paint in class BasicButtonUI
Parameters:
g - The graphics context to paint with
c - The component to paint the state of

paintIcon

protected void paintIcon(Graphics g,
                         AbstractButton b,
                         Rectangle iconRect)
Paints the icon for the toggle button. This delegates to BasicButtonUI.paintIcon(Graphics, JComponent, Rectangle).

Parameters:
g - the graphics context
b - the button to paint the icon for
iconRect - the area allocated for the icon