public class IconUIResource extends Object implements Icon, UIResource, Serializable
UIResource
, which
indicates that it has been installed by a pluggable
LookAndFeel. Such icons are replaced when the LookAndFeel
changes.Constructor and Description |
---|
IconUIResource(Icon delegate)
Constructs a
IconUIResource that wraps another
icon. |
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight()
Returns the height of the icon in pixels.
|
int |
getIconWidth()
Returns the width of the icon in pixels.
|
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
Paints the icon by asking the delegate icon to paint itself.
|
public IconUIResource(Icon delegate)
IconUIResource
that wraps another
icon. All messages are forwarded to the delegate icon.delegate
- the icon that is wrapped by this
IconUIResource
(null
not permitted).public void paintIcon(Component c, Graphics g, int x, int y)
paintIcon
in interface Icon
c
- the Component whose icon is being painted. Some icons
use this argument to retrieve properties like the
background color.g
- the graphics into which the icon will be painted.x
- the horizontal position of the icon.y
- the vertical position of the icon.public int getIconWidth()
getIconWidth
in interface Icon
public int getIconHeight()
getIconHeight
in interface Icon