dsto.dfc.swing.controls
Class ColourSwatchIcon

java.lang.Object
  extended by dsto.dfc.swing.controls.ColourSwatchIcon
All Implemented Interfaces:
Copyable, Serializable, Cloneable, Icon

public class ColourSwatchIcon
extends Object
implements Icon, Serializable, Copyable

An icon that displays a rectangular coloured swatch.

Version:
$Revision$
See Also:
Serialized Form

Field Summary
protected  Color colour
           
protected  int height
           
protected  int width
           
 
Constructor Summary
ColourSwatchIcon()
           
ColourSwatchIcon(Color colour)
           
ColourSwatchIcon(Color colour, int width, int height)
           
 
Method Summary
 Object clone()
          Create a completely separate copy of this object and any mutable objects owned by the object.
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(Component c, Graphics g, int x, int y)
           
 void setColor(Color colour)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

protected int width

height

protected int height

colour

protected Color colour
Constructor Detail

ColourSwatchIcon

public ColourSwatchIcon()

ColourSwatchIcon

public ColourSwatchIcon(Color colour)

ColourSwatchIcon

public ColourSwatchIcon(Color colour,
                        int width,
                        int height)
Method Detail

setColor

public void setColor(Color colour)

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from interface: Copyable
Create a completely separate copy of this object and any mutable objects owned by the object.

NOTE: subclasses should not remove the CloneNotSupportedException throws clause if they themselves support subclassing: removing the CloneNotSupportedException declaration stops subclasses from indicating that a clone was not possible.

Specified by:
clone in interface Copyable
Overrides:
clone in class Object
Throws:
CloneNotSupportedException - if the clone failed or is not possible.


Copyright © 2008 Commonwealth of Australia