|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.ide.controls.ColorIcon
The ColorIcon
is an Icon
implementation
that is a simple rectangular shape with a black edge rim, and
configurable center fill color. The size of the icon must be
specified when it is created, but the fill color may be changed
later.
Field Summary | |
static int |
DEFAULT_HEIGHT
The default icon height (12) to use if none is specified. |
static int |
DEFAULT_SIZE
The default icon size (square) to use if none is specified. |
static int |
DEFAULT_WIDTH
The default icon width (12) to use if none is specified. |
Constructor Summary | |
ColorIcon(java.awt.Color color)
Construct a new ColorIcon with the given fill
color and with a default size |
|
ColorIcon(java.awt.Color color,
java.awt.Dimension dimensions)
Construct a new ColorIcon with the given fill
color and dimensions. |
|
ColorIcon(java.awt.Color color,
int width,
int height)
Construct a new ColorIcon with the given fill
color and dimensions. |
Method Summary | |
java.awt.Color |
getColor()
Fetches the color that is currently used to fill the icon. |
int |
getIconHeight()
Returns the icon's height. |
int |
getIconWidth()
Returns the icon's width. |
void |
paintIcon(java.awt.Component component,
java.awt.Graphics graphics,
int x,
int y)
Draw the icon at the specified location. |
void |
setColor(java.awt.Color color)
Changes the color that is used to fill the icon. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_SIZE
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
Constructor Detail |
public ColorIcon(java.awt.Color color)
ColorIcon
with the given fill
color and with a default size
color
- the fill color to usepublic ColorIcon(java.awt.Color color, int width, int height)
ColorIcon
with the given fill
color and dimensions.
color
- the fill color to usewidth
- the width to useheight
- the height to usepublic ColorIcon(java.awt.Color color, java.awt.Dimension dimensions)
ColorIcon
with the given fill
color and dimensions.
color
- the fill color to useMethod Detail |
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- the new color to usepublic void paintIcon(java.awt.Component component, java.awt.Graphics graphics, 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
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.