Class ShapeIcon
- java.lang.Object
-
- com.inductiveautomation.ignition.client.util.ShapeIcon
-
- All Implemented Interfaces:
javax.swing.Icon
- Direct Known Subclasses:
JsonEditor.HierarchyIcon
public class ShapeIcon extends java.lang.Object implements javax.swing.Icon
Handy class that lets you use a Shape as an icon. Will paint with anti-alias on.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Method Detail
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics graphics, int x, int y)
- Specified by:
paintIcon
in interfacejavax.swing.Icon
-
setColor
public ShapeIcon setColor(java.awt.Color color)
-
setOffset
public ShapeIcon setOffset(int x, int y)
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight
in interfacejavax.swing.Icon
-
createScaledInstance
public ShapeIcon createScaledInstance(double scale)
-
fromSvgPolygon
public 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. https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/points
-
-