public class PolygonIcon
extends java.lang.Object
implements javax.swing.Icon
| Constructor and Description |
|---|
PolygonIcon(java.awt.Polygon[] p,
java.awt.Dimension size)
Creates a new icon.
|
PolygonIcon(java.awt.Polygon p,
java.awt.Dimension size)
Creates a new icon.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getIconHeight()
Gets the height of the icon.
|
int |
getIconWidth()
Gets the width of the icon.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Draws the icon at the specified location.
|
void |
setFillColor(java.awt.Color color)
Sets the fill color of the polygons.
|
void |
setFilled(boolean b) |
void |
setForeground(java.awt.Color color)
Sets the foreground color of the polygons.
|
public PolygonIcon(java.awt.Polygon[] p,
java.awt.Dimension size)
p - An Array of polygons.size - The fixed width/height of the icon.public PolygonIcon(java.awt.Polygon p,
java.awt.Dimension size)
p - The polygon.size - The fixed width/height of the icon.public void setFillColor(java.awt.Color color)
color - The fill color.
If this is null, the polygons are filled
with the foreground color.public void setFilled(boolean b)
public void setForeground(java.awt.Color color)
color - The foreground color.
If this is null, the polygons are filled
with the foreground color of the Component
hosting the icon.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.Icon