Class SystemMap.SystemMapElement
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.web.models.SystemMap.SystemMapElement
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SystemMap.SystemMapElement>
- Enclosing class:
- SystemMap
public static class SystemMap.SystemMapElement extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<SystemMap.SystemMapElement>
The SystemMapElement is a block inside of the system map, representing distinct part of the overall system. It is created with a title, an order (vertical position index, relative to other elements), and a link to the status panel for the element.After creating the element, the module can add StatusItems to it. Several convenience functions are provided for the most common types of status, such as the number of "connected objects".
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SystemMap.SystemMapElement.StatusItem
A textual status item to be displayed inside a SystemMapElement.static class
SystemMap.SystemMapElement.StatusItemState
-
Constructor Summary
Constructors Constructor Description SystemMapElement(int order, java.lang.String titleKey, java.lang.String statusPanelLink)
SystemMapElement(int order, java.lang.String titleKey, java.lang.String statusPanelLink, boolean linkExternal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNumConnectedStatusItem(int numConnected, int total)
Adds a status item like: "%d/%d connected" that has a warning state if numConnected is less than total.void
addNumOpenStatusItem(int numOpen)
Adds a status item like: "%d open".void
addStatusItem(SystemMap.SystemMapElement.StatusItem statusItem)
void
addStatusItem(java.lang.String display, SystemMap.SystemMapElement.StatusItemState state)
void
addStatusItemf(SystemMap.SystemMapElement.StatusItemState state, java.lang.String bundleKey, java.lang.Object... args)
int
compareTo(SystemMap.SystemMapElement other)
byte[]
getActiveIcon()
byte[]
getInactiveIcon()
java.util.List<SystemMap.SystemMapElement.StatusItem>
getStatusItems()
java.lang.String
getStatusPanelLink()
java.lang.String
getTitle()
boolean
isActive()
boolean
isIconVisible()
boolean
isLinkExternal()
void
setActive(boolean active)
void
setActiveIcon(byte[] activeIcon)
void
setIcons(java.lang.Class<?> relativeTo, java.lang.String pathPattern)
Shortcut for setting the active and inactive icons, assuming they are accessible through the classloader relative to the given class.void
setIconVisible(boolean iconVisible)
void
setInactiveIcon(byte[] inactiveIcon)
-
-
-
Method Detail
-
addNumConnectedStatusItem
public void addNumConnectedStatusItem(int numConnected, int total)
Adds a status item like: "%d/%d connected" that has a warning state if numConnected is less than total. Also clears the SystemMapElement.active flag if total==0
-
addNumOpenStatusItem
public void addNumOpenStatusItem(int numOpen)
Adds a status item like: "%d open". Also clears the SystemMapElement.active flag if numOpen==0
-
addStatusItemf
public void addStatusItemf(SystemMap.SystemMapElement.StatusItemState state, java.lang.String bundleKey, java.lang.Object... args)
-
addStatusItem
public void addStatusItem(java.lang.String display, SystemMap.SystemMapElement.StatusItemState state)
-
addStatusItem
public void addStatusItem(SystemMap.SystemMapElement.StatusItem statusItem)
-
getStatusItems
public java.util.List<SystemMap.SystemMapElement.StatusItem> getStatusItems()
-
compareTo
public int compareTo(SystemMap.SystemMapElement other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<SystemMap.SystemMapElement>
-
getTitle
public java.lang.String getTitle()
-
getStatusPanelLink
public java.lang.String getStatusPanelLink()
-
isLinkExternal
public boolean isLinkExternal()
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean active)
-
getActiveIcon
public byte[] getActiveIcon()
-
setActiveIcon
public void setActiveIcon(byte[] activeIcon)
-
getInactiveIcon
public byte[] getInactiveIcon()
-
setInactiveIcon
public void setInactiveIcon(byte[] inactiveIcon)
-
setIcons
public void setIcons(java.lang.Class<?> relativeTo, java.lang.String pathPattern) throws java.io.IOException
Shortcut for setting the active and inactive icons, assuming they are accessible through the classloader relative to the given class. The path pattern will be used with %s replaced with "active" and "inactive", like so:element.setIcons(getClass(), "images/elmicon_%s.png");
Somewhat cheesy, but effective!
- Throws:
java.io.IOException
- when unable to read from the input streams obtained from class.getResourceAsStream()java.lang.NullPointerException
- if one of the icons is not found.
-
isIconVisible
public boolean isIconVisible()
-
setIconVisible
public void setIconVisible(boolean iconVisible)
-
-