|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.noaa.pmel.sgt.swing.ColorSwatchIcon
public class ColorSwatchIcon
ColorSwatchIcon
implements Icon
to create a
icon that displays a small square of
color. ColorSwatchIcon
is used with property dialogs
to display/edit colors from an IndexedColor
map.
Icon
Constructor Summary | |
---|---|
ColorSwatchIcon(java.awt.Color color,
int width,
int height)
|
|
ColorSwatchIcon(IndexedColor cmap,
int index,
int size)
Construct a ColorSwatchIcon . |
Method Summary | |
---|---|
java.awt.Color |
getColor()
Get icon color. |
int |
getIconHeight()
Get the icon heigth. |
int |
getIconWidth()
Get the icon width. |
int |
getIndex()
Get color index. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paint the icon at the specified location |
void |
propertyChange(java.beans.PropertyChangeEvent event)
ColorSwatchIcon listens for changes to the
IndexedColor color map. |
void |
setSize(int size)
Change the size of the swatch. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ColorSwatchIcon(IndexedColor cmap, int index, int size)
ColorSwatchIcon
.
cmap
- indexed color mapindex
- color indexsize
- swatch size in pixelspublic ColorSwatchIcon(java.awt.Color color, int width, int height)
color
- size
- Method Detail |
---|
public int getIndex()
public java.awt.Color getColor()
public void setSize(int size)
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public java.lang.String toString()
toString
in class java.lang.Object
public void propertyChange(java.beans.PropertyChangeEvent event)
ColorSwatchIcon
listens for changes to the
IndexedColor
color map. If changes occur the swatch
is updated.
propertyChange
in interface java.beans.PropertyChangeListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |