|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swing.controls.CompositeColorSwatchIcon
public class CompositeColorSwatchIcon
An icon that displays a small rectangular coloured swatch under an icon. Can be used for icons like bucket fill that display the current fill colour at the bottom.
Field Summary | |
---|---|
protected Color |
color
|
protected static int |
ICON_HEIGHT
|
protected static int |
ICON_WIDTH
|
protected Icon |
smallIcon
|
Constructor Summary | |
---|---|
CompositeColorSwatchIcon(Icon smallIcon,
Color color)
Create a new icon from a smaller icon and a colour. |
Method Summary | |
---|---|
Object |
clone()
Create a completely separate copy of this object and any mutable objects owned by the object. |
int |
getIconHeight()
|
int |
getIconWidth()
|
Icon |
getSmallIcon()
|
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
|
void |
setColor(Color color)
Set the color for the swatch. |
void |
setSmallIcon(Icon smallIcon)
Set icon displayed at the top. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int ICON_WIDTH
protected static final int ICON_HEIGHT
protected Color color
protected Icon smallIcon
Constructor Detail |
---|
public CompositeColorSwatchIcon(Icon smallIcon, Color color)
smallIcon
- The icon to be displayed above the swatch. Must
be 16x12 or smaller (swatch is 16x4 pixels).color
- The color to display in the swatch.Method Detail |
---|
public void setColor(Color color)
public void setSmallIcon(Icon smallIcon)
public Icon getSmallIcon()
public void paintIcon(Component c, Graphics g, int x, int y)
paintIcon
in interface Icon
public int getIconWidth()
getIconWidth
in interface Icon
public int getIconHeight()
getIconHeight
in interface Icon
public Object clone() throws CloneNotSupportedException
Copyable
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.
clone
in interface Copyable
clone
in class Object
CloneNotSupportedException
- if the clone failed or is not
possible.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |