org.tigris.swidgets

Class DecoratedIcon

Known Direct Subclasses:
DropDownIcon

public abstract class DecoratedIcon
extends ImageIcon

The base class for adding simple decorations to existing icons. This should be extended for each decoration style.
Author:
Bob Tarling

Field Summary

static int
ROLLOVER
If the icon is for hoovering: ROLLOVER
static int
STANDARD
If the icon is the normally shown one: STANDARD

Method Summary

protected void
init(int[][] buffer)
Initialise the icon.
void
paintIcon(Component c, Graphics g, int x, int y)
Paints the icon.

Field Details

ROLLOVER

public static final int ROLLOVER
If the icon is for hoovering: ROLLOVER
Field Value:
0

STANDARD

public static final int STANDARD
If the icon is the normally shown one: STANDARD
Field Value:
1

Method Details

init

protected void init(int[][] buffer)
Initialise the icon.
Parameters:
buffer - the buffer containing the icon definition (pixels)

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Paints the icon. The top-left corner of the icon is drawn at the point (x, y) in the coordinate space of the graphics context g. If this icon has no image observer, this method uses the c component as the observer.
Parameters:
c - the component to be used as the observer if this icon has no image observer
g - the graphics context
x - the X coordinate of the icon's top-left corner
y - the Y coordinate of the icon's top-left corner