public class PolygonIcon
extends java.awt.Polygon
implements javax.swing.Icon
Constructor and Description |
---|
PolygonIcon()
Creates a polygon icon to be drawn with the the foreground color of the
containing component and with no margin.
|
PolygonIcon(java.awt.Color color)
Creates a polygon icon to be drawn with a specified foreground color and
with no margin.
|
PolygonIcon(java.awt.Color color,
int[] xpoints,
int[] ypoints,
int npoints)
Creates a polygon icon to be drawn with a specified foreground color and
points and with no margin.
|
PolygonIcon(java.awt.Color color,
int top,
int left,
int bottom,
int right)
Creates a polygon icon to be drawn with specified foreground color and
margin.
|
PolygonIcon(java.awt.Color color,
int top,
int left,
int bottom,
int right,
int[] xpoints,
int[] ypoints,
int npoints)
Creates a polygon icon to be drawn with specified foreground color, margin
and points.
|
PolygonIcon(int[] xpoints,
int[] ypoints,
int npoints)
Creates a polygon icon to be drawn with the the foreground color of the
containing component, with no margin, and with the specified points.
|
PolygonIcon(int top,
int left,
int bottom,
int right)
Creates a polygon icon to be drawn with the foreground color of the
containing component and with a specified margin.
|
PolygonIcon(int top,
int left,
int bottom,
int right,
int[] xpoints,
int[] ypoints,
int npoints)
Creates a polygon icon to be drawn with the foreground color of the
containing component and with specified margin and points.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoints(int[] xpoints,
int[] ypoints,
int npoints)
Adds points to this polygon.
|
java.awt.Color |
getColor() |
protected java.awt.Color |
getColor(java.awt.Component c) |
int |
getIconHeight() |
int |
getIconWidth() |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
void |
setColor(java.awt.Color color)
Sets the foreground color, or null to use the foreground color of the
containing component.
|
void |
setMargin(int top,
int left,
int bottom,
int right)
Sets the margin.
|
public PolygonIcon()
public PolygonIcon(int[] xpoints, int[] ypoints, int npoints)
public PolygonIcon(java.awt.Color color)
public PolygonIcon(java.awt.Color color, int[] xpoints, int[] ypoints, int npoints)
public PolygonIcon(int top, int left, int bottom, int right)
public PolygonIcon(int top, int left, int bottom, int right, int[] xpoints, int[] ypoints, int npoints)
public PolygonIcon(java.awt.Color color, int top, int left, int bottom, int right)
public PolygonIcon(java.awt.Color color, int top, int left, int bottom, int right, int[] xpoints, int[] ypoints, int npoints)
public void setColor(java.awt.Color color)
public void addPoints(int[] xpoints, int[] ypoints, int npoints)
xpoints
- An array of x ordinates, one for each point to add.ypoints
- An array of y ordinates, one for each point to add.npoints
- The number of points to add.public void setMargin(int top, int left, int bottom, int right)
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public java.awt.Color getColor()
protected java.awt.Color getColor(java.awt.Component c)
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon