Class VectorIcons
- java.lang.Object
-
- com.inductiveautomation.ignition.client.icons.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VectorIcons
createFromJson(java.io.Reader json)
Create a new instance of VectorIcons from a reader.static VectorIcon
get(java.lang.String name)
Fetch an icon of the given name from the built-in icon source.static VectorIcon
get(java.lang.String name, java.awt.Color color)
Fetch an icon of the given name from the built-in icon source.VectorIcon
getIcon(java.lang.String name)
VectorIcon
getIcon(java.lang.String name, java.awt.Color color)
static InteractiveVectorIcon
getInteractive(java.lang.String name)
Fetch an icon from the built-in icon source, and return it as anInteractiveIcon
InteractiveVectorIcon
getInteractiveIcon(java.lang.String name)
-
-
-
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 namederror
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)
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
-
getInteractive
public static InteractiveVectorIcon getInteractive(java.lang.String name)
Fetch an icon from the built-in icon source, and return it as anInteractiveIcon
-
getIcon
public VectorIcon getIcon(java.lang.String name)
-
getIcon
public VectorIcon getIcon(java.lang.String name, java.awt.Color color)
-
getInteractiveIcon
public InteractiveVectorIcon getInteractiveIcon(java.lang.String name)
-
-