kaos.kpat.applet
Class TreeIcon

java.lang.Object
  extended by kaos.kpat.applet.TreeIcon
All Implemented Interfaces:
javax.swing.Icon

public class TreeIcon
extends java.lang.Object
implements javax.swing.Icon

Paints a circle of the specified color, with the specified letter in it.


Field Summary
static int FONT_SIZE
           
static int ICON_SIZE
           
static int START_X
           
 
Constructor Summary
TreeIcon()
          No param constructor.
TreeIcon(java.lang.String letter)
          Letter-only constructor.
TreeIcon(java.lang.String letter, java.awt.Color c)
          Letter- and color-specified constructor.
TreeIcon(java.lang.String letter, java.awt.Color c, int offset)
          The full-up constructor.
 
Method Summary
 int getIconHeight()
          Required by Icon interface.
 int getIconWidth()
          Required by Icon interface.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Required by Icon interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICON_SIZE

public static final int ICON_SIZE
See Also:
Constant Field Values

FONT_SIZE

public static final int FONT_SIZE
See Also:
Constant Field Values

START_X

public static final int START_X
See Also:
Constant Field Values
Constructor Detail

TreeIcon

public TreeIcon(java.lang.String letter,
                java.awt.Color c,
                int offset)
The full-up constructor. Specifies letter, color, and offset. The letter "P", for instance, isn't centered nicely, so 'offset' provides a way to fix it.


TreeIcon

public TreeIcon()
No param constructor. An unknown letter.


TreeIcon

public TreeIcon(java.lang.String letter)
Letter-only constructor. Paint it in red.


TreeIcon

public TreeIcon(java.lang.String letter,
                java.awt.Color c)
Letter- and color-specified constructor. Use zero offset.

Method Detail

getIconHeight

public int getIconHeight()
Required by Icon interface.

Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Required by Icon interface.

Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Required by Icon interface.

Specified by:
paintIcon in interface javax.swing.Icon