Class VectorIcons


  • public class VectorIcons
    extends java.lang.Object

    Represents a source of VectorIcon instances. This class is made to be used with a json source file which stores the source of the vector icons. The json format is expected to be an array of objects, each object containing "name" and "paths".

    "name" is a string, the name/key of the icon. "paths" is an array of one or more strings. The strings must conform to the "d" attribute rules of an SVG path, see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d for reference.

    This class also contains static accessors for a static instance of VectorIcons for all of the icons that are part of the Ignition platform itself.

    • Method Detail

      • createFromJson

        public static VectorIcons createFromJson​(java.io.Reader json)
        Create a new instance of VectorIcons from a reader. Once created, use getIcon(String) or getInteractive(String) to retrieve a specific icon from the supplied JSON.

        Supply an icon named error to use a custom fallback icon (should an invalid name be provided) - if no error icon is provided, a default will be used.

      • get

        public static VectorIcon get​(java.lang.String name,
                                     java.awt.Color color)
        Fetch an icon of the given name from the built-in icon source.
        Parameters:
        name - Name of the icon
        color - Color to use as fill
      • getIcon

        public VectorIcon getIcon​(java.lang.String name)
      • getIcon

        public VectorIcon getIcon​(java.lang.String name,
                                  java.awt.Color color)
      • getInteractive

        public static InteractiveVectorIcon getInteractive​(java.lang.String name,
                                                           java.awt.Color primary)
      • getInteractive

        public static InteractiveVectorIcon getInteractive​(java.lang.String name,
                                                           java.awt.Color primary,
                                                           java.awt.Color selected,
                                                           java.awt.Color disabled,
                                                           java.awt.Color focused)
      • getInteractiveIcon

        public InteractiveVectorIcon getInteractiveIcon​(java.lang.String name,
                                                        java.awt.Color primary,
                                                        java.awt.Color selected,
                                                        java.awt.Color disabled,
                                                        java.awt.Color focused)
      • main

        public static void main​(java.lang.String[] args)