Class VectorIcons
- java.lang.Object
-
- com.inductiveautomation.ignition.client.icons.VectorIcons
-
public class VectorIcons extends java.lang.ObjectRepresents a source of
VectorIconinstances. 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VectorIconscreateFromJson(java.io.Reader json)Create a new instance of VectorIcons from a reader.static VectorIconget(java.lang.String name)Fetch an icon of the given name from the built-in icon source.static VectorIconget(java.lang.String name, java.awt.Color color)Fetch an icon of the given name from the built-in icon source.VectorIcongetIcon(java.lang.String name)VectorIcongetIcon(java.lang.String name, java.awt.Color color)static InteractiveVectorIcongetInteractive(java.lang.String name)Fetch an icon from the built-in icon source, and return it as anInteractiveIconstatic InteractiveVectorIcongetInteractive(java.lang.String name, java.awt.Color primary)static InteractiveVectorIcongetInteractive(java.lang.String name, java.awt.Color primary, java.awt.Color selected, java.awt.Color disabled, java.awt.Color focused)InteractiveVectorIcongetInteractiveIcon(java.lang.String name, java.awt.Color primary, java.awt.Color selected, java.awt.Color disabled, java.awt.Color focused)static voidmain(java.lang.String[] args)
-
-
-
Method Detail
-
createFromJson
public static VectorIcons createFromJson(java.io.Reader json)
Create a new instance of VectorIcons from a reader. Once created, usegetIcon(String)orgetInteractive(String)to retrieve a specific icon from the supplied JSON.Supply an icon named
errorto 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)
Fetch an icon of the given name from the built-in icon source. Color will beIgnitionLookAndFeel.Colors.IconDefault
-
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 iconcolor- 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)
Fetch an icon from the built-in icon source, and return it as anInteractiveIcon
-
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)
-
-