info.monitorenter.gui.util
Class ColorIcon

java.lang.Object
  extended by info.monitorenter.gui.util.ColorIcon
All Implemented Interfaces:
Icon

public class ColorIcon
extends Object
implements Icon

An icon that displays a rectangular Color.

Version:
$Revision: 1.3 $
Author:
Achim Westermann

Constructor Summary
ColorIcon(Color color)
          Creates an icon with the given color.
 
Method Summary
 Color getColor()
          Returns the color of this icon.
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(Component c, Graphics g, int x, int y)
           
 void setColor(Color color)
          Sets the color of this icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorIcon

public ColorIcon(Color color)
Creates an icon with the given color.

Parameters:
color - the color of this icon.
Method Detail

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon
See Also:
Icon.getIconHeight()

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon
See Also:
Icon.getIconWidth()

paintIcon

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

getColor

public final Color getColor()
Returns the color of this icon.

Returns:
the color of this icon.

setColor

public final void setColor(Color color)
Sets the color of this icon.

Parameters:
color - The color of this icon to set.


Copyright © 2001 - 2007 LGPL, All Rights Footloose.