|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--gov.noaa.pmel.sgt.swing.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 |
equals, 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 pixels
public ColorSwatchIcon(java.awt.Color color,
int width,
int height)
color - | 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.Iconpublic int getIconWidth()
getIconWidth in interface javax.swing.Iconpublic int getIconHeight()
getIconHeight in interface javax.swing.Iconpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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
|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||