|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkiwi.ui.ColorSwatch
A simple component that renders a color swatch--a filled rectangle with a thin black border.
Field Summary | |
private java.awt.Color |
color
|
static java.awt.Color |
DEFAULT_COLOR
The default swatch color. |
static int |
DEFAULT_HEIGHT
The default swatch height. |
static int |
DEFAULT_WIDTH
The default swatch width. |
private int |
h
|
private int |
w
|
Constructor Summary | |
ColorSwatch()
Construct a new ColorSwatch with a default color, width,
and height. |
|
ColorSwatch(java.awt.Color color,
int width,
int height)
Construct a new ColorSwatch with the specified color and
geometry. |
Method Summary | |
java.awt.Color |
getColor()
Get the color of this swatch. |
int |
getIconHeight()
Get the height of the swatch. |
int |
getIconWidth()
Get the width of the swatch. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics gc,
int x,
int y)
Paint the swatch (as an icon). |
void |
setColor(java.awt.Color color)
Set the color of this swatch. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.awt.Color color
private int w
private int h
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final java.awt.Color DEFAULT_COLOR
Constructor Detail |
public ColorSwatch()
ColorSwatch
with a default color, width,
and height.
public ColorSwatch(java.awt.Color color, int width, int height)
ColorSwatch
with the specified color and
geometry.
color
- The color for the swatch.width
- The width, in pixels.height
- The height, in pixels.Method Detail |
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- The new color for the swatch.public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public void paintIcon(java.awt.Component c, java.awt.Graphics gc, int x, int y)
paintIcon
in interface javax.swing.Icon
c
- The component to paint the swatch in.gc
- The graphics context.x
- The x-coordinate.y
- The y-coordinate.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |