APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicToggleButtonUI

extends BasicButtonUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.metal.MetalToggleButtonUI, com.sun.java.swing.plaf.motif.MotifToggleButtonUI, javax.swing.plaf.basic.BasicRadioButtonUI
Imports
java.awt.*, java.awt.event.*, javax.swing.*, javax.swing.border.*, javax.swing.plaf.*, javax.swing.text.View

BasicToggleButton implementation
Author
Jeff Dinkins

Field Summary

Modifier and TypeField and Description
private static final String
private static final ComponentUI
Inherited from javax.swing.plaf.basic.BasicButtonUI:
defaultTextIconGapdefaultTextShiftOffset

Constructor Summary

AccessConstructor and Description
public
BasicToggleButtonUI()

Constructs a BasicToggleButtonUI.

Method Summary

Modifier and TypeMethod and Description
public static ComponentUI

Returns:

an instance of BasicToggleButtonUI
createUI
(JComponent
a component
b
)

Hides javax.swing.plaf.basic.BasicButtonUI.createUI.

Returns an instance of BasicToggleButtonUI.

protected String
protected int
getTextShiftOffset()

Overrides javax.swing.plaf.basic.BasicButtonUI.getTextShiftOffset.

Overridden so that the text will not be rendered as shifted for Toggle buttons and subclasses.

public void
paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicButtonUI.paint.

Paints the specified component appropriately for the look and feel.

protected void
paintIcon(Graphics
an instance of Graphics
g
,
AbstractButton
an instance of Button
b
,
Rectangle
bounds of an icon
iconRect
)

Paints an icon in the specified location.

Inherited from javax.swing.plaf.basic.BasicButtonUI:
clearTextShiftOffsetcreateButtonListenergetBaselinegetBaselineResizeBehaviorgetDefaultTextIconGapgetMaximumSizegetMinimumSizegetPreferredSizeinstallDefaultsinstallKeyboardActionsinstallListenersinstallUIpaintButtonPressedpaintFocuspaintIconpaintTextpaintTextsetTextShiftOffsetuninstallDefaultsuninstallKeyboardActionsuninstallListenersuninstallUI

Field Detail

propertyPrefixback to summary
private static final String propertyPrefix

Hides javax.swing.plaf.basic.BasicButtonUI.propertyPrefix.

UIback to summary
private static final ComponentUI UI

Hides javax.swing.plaf.basic.BasicButtonUI.UI.

Constructor Detail

BasicToggleButtonUIback to summary
public BasicToggleButtonUI()

Constructs a BasicToggleButtonUI.

Method Detail

createUIback to summary
public static ComponentUI createUI(JComponent b)

Hides javax.swing.plaf.basic.BasicButtonUI.createUI.

Returns an instance of BasicToggleButtonUI.

Parameters
b:JComponent

a component

Returns:ComponentUI

an instance of BasicToggleButtonUI

getPropertyPrefixback to summary
protected String getPropertyPrefix()

Overrides javax.swing.plaf.basic.BasicButtonUI.getPropertyPrefix.

Doc from javax.swing.plaf.basic.BasicButtonUI.getPropertyPrefix.

Returns the property prefix.

getTextShiftOffsetback to summary
protected int getTextShiftOffset()

Overrides javax.swing.plaf.basic.BasicButtonUI.getTextShiftOffset.

Overridden so that the text will not be rendered as shifted for Toggle buttons and subclasses.

paintback to summary
public void paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicButtonUI.paint.

Doc from javax.swing.plaf.ComponentUI.paint.

Paints the specified component appropriately for the look and feel. This method is invoked from the ComponentUI.update method when the specified component is being painted. Subclasses should override this method and use the specified Graphics object to render the content of the component.

paintIconback to summary
protected void paintIcon(Graphics g, AbstractButton b, Rectangle iconRect)

Paints an icon in the specified location.

Parameters
g:Graphics

an instance of Graphics

b:AbstractButton

an instance of Button

iconRect:Rectangle

bounds of an icon