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

public Class IconUIResource

extends Object
implements Icon, UIResource, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.swing.plaf.UIResource, javax.swing.Icon
Known Direct Subclasses
javax.swing.plaf.metal.OceanTheme.COIcon, javax.swing.plaf.metal.OceanTheme.IFIcon
Annotations
@SuppressWarnings:serial
Imports
java.awt.Component, .Graphics, java.io.Serializable, javax.swing.Icon, javax.swing.plaf.UIResource

An Icon wrapper class which implements UIResource. UI classes which set icon properties should use this class to wrap any icons specified as defaults. This class delegates all method invocations to the Icon "delegate" object specified at construction.

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
Amy Fowler
See Also
javax.swing.plaf.UIResource

Field Summary

Modifier and TypeField and Description
private Icon

Constructor Summary

AccessConstructor and Description
public
IconUIResource(Icon
the icon being wrapped
delegate
)

Creates a UIResource icon object which wraps an existing Icon instance.

Method Summary

Modifier and TypeMethod and Description
public int
getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Returns the icon's height.

public int
getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Returns the icon's width.

public void
paintIcon(Component c, Graphics g, int x, int y)

Implements javax.swing.Icon.paintIcon.

Draw the icon at the specified location.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private Icon delegate

Constructor Detail

IconUIResourceback to summary
public IconUIResource(Icon delegate)

Creates a UIResource icon object which wraps an existing Icon instance.

Parameters
delegate:Icon

the icon being wrapped

Method Detail

getIconHeightback to summary
public int getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Doc from javax.swing.Icon.getIconHeight.

Returns the icon's height.

getIconWidthback to summary
public int getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Doc from javax.swing.Icon.getIconWidth.

Returns the icon's width.

paintIconback to summary
public void paintIcon(Component c, Graphics g, int x, int y)

Implements javax.swing.Icon.paintIcon.

Doc from javax.swing.Icon.paintIcon.

Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.