public class ShapeIcon
extends java.lang.Object
implements javax.swing.Icon
| Constructor and Description |
|---|
ShapeIcon(java.awt.Shape shape,
java.awt.Color color,
int width,
int height) |
ShapeIcon(java.util.function.Supplier<java.awt.Shape> shapeGen,
java.awt.Color color,
int width,
int height) |
| Modifier and Type | Method and Description |
|---|---|
ShapeIcon |
createScaledInstance(double scale) |
static java.awt.geom.Path2D.Double |
fromSvgPolygon(java.lang.String polygonPoints)
Creates a polygon path from a string which would be of the same format as an SVG polygon element's points
attribute.
|
int |
getIconHeight() |
int |
getIconWidth() |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics graphics,
int x,
int y) |
ShapeIcon |
setColor(java.awt.Color color) |
ShapeIcon |
setOffset(int x,
int y) |
public ShapeIcon(java.util.function.Supplier<java.awt.Shape> shapeGen,
java.awt.Color color,
int width,
int height)
public ShapeIcon(java.awt.Shape shape,
java.awt.Color color,
int width,
int height)
public void paintIcon(java.awt.Component c,
java.awt.Graphics graphics,
int x,
int y)
paintIcon in interface javax.swing.Iconpublic ShapeIcon setColor(java.awt.Color color)
public ShapeIcon setOffset(int x, int y)
public int getIconWidth()
getIconWidth in interface javax.swing.Iconpublic int getIconHeight()
getIconHeight in interface javax.swing.Iconpublic ShapeIcon createScaledInstance(double scale)
public static java.awt.geom.Path2D.Double fromSvgPolygon(java.lang.String polygonPoints)