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

public Class MetalButtonUI

extends BasicButtonUI
Class Inheritance
Imports
sun.swing.SwingUtilities2, javax.swing.*, javax.swing.border.*, javax.swing.plaf.basic.*, java.awt.*, java.awt.event.*, java.beans.*, javax.swing.plaf.*

MetalButtonUI implementation

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
Tom Santos

Field Summary

Modifier and TypeField and Description
protected Color
disabledTextColor

The color of the disabled color.

protected Color
focusColor

The color of the focused button.

protected Color
selectColor

The color of the selected button.

private static final ComponentUI
Inherited from javax.swing.plaf.basic.BasicButtonUI:
defaultTextIconGapdefaultTextShiftOffset

Constructor Summary

AccessConstructor and Description
public
MetalButtonUI()

Constructs a MetalButtonUI.

Method Summary

Modifier and TypeMethod and Description
protected BasicButtonListener
createButtonListener(AbstractButton b)

Overrides javax.swing.plaf.basic.BasicButtonUI.createButtonListener.

Returns a new instance of BasicButtonListener.

public static ComponentUI

Returns:

an instance of MetalButtonUI
createUI
(JComponent
a component
c
)

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

Returns an instance of MetalButtonUI.

protected Color

Returns:

the color of a disabled text
getDisabledTextColor
()

Returns the color of a disabled text.

protected Color

Returns:

the color of the focused button
getFocusColor
()

Returns the color of the focused button.

protected Color

Returns:

the color of the selected button
getSelectColor
()

Returns the color of the selected button.

public void
protected void
protected void
paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)

Overrides javax.swing.plaf.basic.BasicButtonUI.paintFocus.

Paints a focused button.

protected void
paintText(Graphics g, JComponent c, Rectangle textRect, String text)

Overrides javax.swing.plaf.basic.BasicButtonUI.paintText.

Method which renders the text of the current button.

public void
public void
update(Graphics
Graphics to paint to
g
,
JComponent
JComponent painting on
c
)

Overrides javax.swing.plaf.ComponentUI.update.

If necessary paints the background of the component, then invokes paint.

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

Field Detail

disabledTextColorback to summary
protected Color disabledTextColor

The color of the disabled color.

focusColorback to summary
protected Color focusColor

The color of the focused button.

selectColorback to summary
protected Color selectColor

The color of the selected button.

UIback to summary
private static final ComponentUI UI

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

Constructor Detail

MetalButtonUIback to summary
public MetalButtonUI()

Constructs a MetalButtonUI.

Method Detail

createButtonListenerback to summary
protected BasicButtonListener createButtonListener(AbstractButton b)

Overrides javax.swing.plaf.basic.BasicButtonUI.createButtonListener.

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

Returns a new instance of BasicButtonListener.

createUIback to summary
public static ComponentUI createUI(JComponent c)

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

Returns an instance of MetalButtonUI.

Parameters
c:JComponent

a component

Returns:ComponentUI

an instance of MetalButtonUI

getDisabledTextColorback to summary
protected Color getDisabledTextColor()

Returns the color of a disabled text.

Returns:Color

the color of a disabled text

getFocusColorback to summary
protected Color getFocusColor()

Returns the color of the focused button.

Returns:Color

the color of the focused button

getSelectColorback to summary
protected Color getSelectColor()

Returns the color of the selected button.

Returns:Color

the color of the selected button

installDefaultsback to summary
public void installDefaults(AbstractButton b)

Overrides javax.swing.plaf.basic.BasicButtonUI.installDefaults.

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

Installs default properties.

paintButtonPressedback to summary
protected void paintButtonPressed(Graphics g, AbstractButton b)

Overrides javax.swing.plaf.basic.BasicButtonUI.paintButtonPressed.

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

Paints a pressed button.

paintFocusback to summary
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)

Overrides javax.swing.plaf.basic.BasicButtonUI.paintFocus.

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

Paints a focused button.

paintTextback to summary
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text)

Overrides javax.swing.plaf.basic.BasicButtonUI.paintText.

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

Method which renders the text of the current button. As of Java 2 platform v 1.4 this method should not be used or overridden. Use the paintText method which takes the AbstractButton argument.

uninstallDefaultsback to summary
public void uninstallDefaults(AbstractButton b)

Overrides javax.swing.plaf.basic.BasicButtonUI.uninstallDefaults.

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

Uninstalls default properties.

updateback to summary
public void update(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.update.

If necessary paints the background of the component, then invokes paint.

Parameters
g:Graphics

Graphics to paint to

c:JComponent

JComponent painting on

Exceptions
NullPointerException:
if g or c is null
Since
1.5
See Also
javax.swing.plaf.ComponentUI#update, javax.swing.plaf.ComponentUI#paint