public class StrokeSwatch
extends java.lang.Object
implements javax.swing.Icon
StrokeSwatch
class is an icon that shows a
rectangle of a given line pattern.Constructor and Description |
---|
StrokeSwatch(java.awt.Stroke stroke,
int width,
int height)
Create a new stroke swatch.
|
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight()
Gets the icon height.
|
int |
getIconWidth()
Gets the icon width.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paints the icon to the specified graphics context.
|
void |
setStroke(java.awt.Stroke stroke)
Sets the swatch stroke.
|
public StrokeSwatch(java.awt.Stroke stroke, int width, int height)
stroke
- the stroke to display.width
- the icon width.height
- the icon height.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 g, int x, int y)
paintIcon
in interface javax.swing.Icon
public void setStroke(java.awt.Stroke stroke)