org.jhotdraw.draw.action
Class ColorIcon

java.lang.Object
  extended by org.jhotdraw.draw.action.ColorIcon
All Implemented Interfaces:
javax.swing.Icon

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

ColorIcon.

Version:
$Id: ColorIcon.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer

Field Summary
private  java.awt.Color fillColor
           
private  int height
           
private  java.lang.String name
           
private static java.awt.image.BufferedImage noColorImage
           
private  int width
           
 
Constructor Summary
ColorIcon(java.awt.Color color)
           
ColorIcon(java.awt.Color color, java.lang.String name)
           
ColorIcon(java.awt.Color color, java.lang.String name, int width, int height)
           
ColorIcon(int rgb)
          Creates a new instance.
ColorIcon(int rgb, java.lang.String name)
           
 
Method Summary
 java.awt.Color getColor()
           
 int getIconHeight()
           
 int getIconWidth()
           
 java.lang.String getName()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fillColor

private java.awt.Color fillColor

noColorImage

private static java.awt.image.BufferedImage noColorImage

width

private int width

height

private int height

name

private java.lang.String name
Constructor Detail

ColorIcon

public ColorIcon(int rgb)
Creates a new instance.


ColorIcon

public ColorIcon(java.awt.Color color)

ColorIcon

public ColorIcon(int rgb,
                 java.lang.String name)

ColorIcon

public ColorIcon(java.awt.Color color,
                 java.lang.String name)

ColorIcon

public ColorIcon(java.awt.Color color,
                 java.lang.String name,
                 int width,
                 int height)
Method Detail

getColor

public java.awt.Color getColor()

getName

public java.lang.String getName()

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon