java.lang.Object
com.inductiveautomation.ignition.client.util.ShapeIcon
All Implemented Interfaces:
Icon
Direct Known Subclasses:
JsonEditor.HierarchyIcon

public class ShapeIcon extends Object implements Icon
Handy class that lets you use a Shape as an icon. Will paint with anti-alias on.
  • Field Details

    • shape

      protected final Shape shape
    • color

      protected Color color
    • offX

      protected int offX
    • offY

      protected int offY
  • Constructor Details

    • ShapeIcon

      public ShapeIcon(Supplier<Shape> shapeGen, Color color, int width, int height)
    • ShapeIcon

      public ShapeIcon(Shape shape, Color color, int width, int height)
  • Method Details

    • paintIcon

      public void paintIcon(Component c, Graphics graphics, int x, int y)
      Specified by:
      paintIcon in interface Icon
    • setColor

      public ShapeIcon setColor(Color color)
    • setOffset

      public ShapeIcon setOffset(int x, int y)
    • getIconWidth

      public int getIconWidth()
      Specified by:
      getIconWidth in interface Icon
    • getIconHeight

      public int getIconHeight()
      Specified by:
      getIconHeight in interface Icon
    • createScaledInstance

      public ShapeIcon createScaledInstance(double scale)
    • fromSvgPolygon

      public static Path2D.Double fromSvgPolygon(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