dsto.dfc.swing.controls
Class ColourSwatchIcon
java.lang.Object
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
width
protected int width
height
protected int height
colour
protected Color colour
ColourSwatchIcon
public ColourSwatchIcon()
ColourSwatchIcon
public ColourSwatchIcon(Color colour)
ColourSwatchIcon
public ColourSwatchIcon(Color colour,
int width,
int height)
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