Class ChartUIModel
- java.lang.Object
- 
- com.inductiveautomation.sfc.uimodel.ChartUIModel
 
- 
 public class ChartUIModel extends java.lang.ObjectThis is the root of the object hierarchy which is serialized into the project resource, it represents the chart as it is displayed in the UI.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringRESOURCE_NAMEstatic ResourceTypeRESOURCE_TYPEstatic intSCOPE
 - 
Constructor SummaryConstructors Constructor Description ChartUIModel()ChartUIModel(ChartUIModel parentModel)Creates a chart UI model that is part of a parallel section
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddChartElement(ChartUIElement element)voidaddChartUIModelListener(ChartUIModelListener listener)voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)voidaddPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)static ChartUIModelcreateNew()Creates a new chart with a begin step at x=5, y=1com.google.common.base.Optional<ChartUIElement>find(int x, int y)com.google.common.base.Optional<ChartUIElement>find(int x, int y, ElementType type)com.google.common.base.Optional<ChartUIElement>find(java.util.UUID id)java.util.List<ChartUIElement>findElementsAt(int x, int y)java.util.List<ChartUIElement>findParallelBegins()Find the Begin Step elements that start the parallel branches.protected voidfireElementAdded(ChartUIElement element)protected voidfireElementRemoved(ChartUIElement element)protected voidfireStructureChanged()static ChartUIModelfromXml(java.io.InputStream xmlInput, StepRegistry registry)Parses the input stream as XML which should represent a ChartUIModelstatic ChartUIModelfromXml(org.w3c.dom.Element sfcElement, StepRegistry registry)java.awt.DimensiongetCanvasSize()java.lang.Iterable<ChartUIElement>getChartElements()Return an iterable view of all chart elements.static LinkDirectiongetConnectivity(ChartUIElement element, Edge direction)LinkDirectiongetConnectivityAt(int x, int y, Edge direction)Tests whether the element at the given location is connectable on the given edge, and if so, what direction the connection should beChartExecutionModegetExecutionMode()java.lang.StringgetOnAbortScript()java.lang.StringgetOnCancelScript()java.lang.StringgetOnRedundantFailoverScript()java.lang.StringgetOnStartScript()java.lang.StringgetOnStopScript()com.google.common.base.Optional<ChartUIModel>getParentModel()ChartUIModelgetParentModelSerializer()Deprecated.ResourcePathgetResourcePath()java.util.List<ChartUIElement>getSFCElements()Deprecated.floatgetZoom()Returns the zoom amount.inthashCode()booleanisHotEditable()booleanisParallelSectionModel()booleanisPersistState()booleanisRedundantSync()static java.awt.DimensionparseDimension(java.lang.String attributeValue)voidremoveChartElement(java.util.UUID id)voidremoveChartUIModelListener(ChartUIModelListener listener)voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)voidremovePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)voidsetCanvasSize(java.awt.Dimension canvasSize)voidsetExecutionMode(ChartExecutionMode executionMode)voidsetHotEditable(boolean hotEditable)voidsetOnAbortScript(java.lang.String onAbortScript)voidsetOnCancelScript(java.lang.String onCancelScript)voidsetOnRedundantFailoverScript(java.lang.String onRedundantFailoverScript)voidsetOnStartScript(java.lang.String onStartScript)voidsetOnStopScript(java.lang.String onStopScript)voidsetParentModelSerializer(ChartUIModel parentModel)Deprecated.voidsetPersistState(boolean persistState)voidsetRedundantSync(boolean redundantSync)voidsetResourcePath(ResourcePath resourcePath)voidsetSFCElements(java.util.List<ChartUIElement> elements)Deprecated.voidsetZoom(float zoom)java.lang.StringtoXml(StepRegistry registry)voidtoXml(javax.xml.stream.XMLStreamWriter writer, StepRegistry registry)Outputs this chart UI model to the XML stream.
 
- 
- 
- 
Field Detail- 
RESOURCE_TYPEpublic static final ResourceType RESOURCE_TYPE 
 - 
RESOURCE_NAMEpublic static final java.lang.String RESOURCE_NAME - See Also:
- Constant Field Values
 
 - 
SCOPEpublic static final int SCOPE - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ChartUIModelpublic ChartUIModel() 
 - 
ChartUIModelpublic ChartUIModel(ChartUIModel parentModel) Creates a chart UI model that is part of a parallel section
 
- 
 - 
Method Detail- 
createNewpublic static ChartUIModel createNew() Creates a new chart with a begin step at x=5, y=1
 - 
setResourcePathpublic void setResourcePath(ResourcePath resourcePath) 
 - 
getResourcePath@Nullable public ResourcePath getResourcePath() 
 - 
toXmlpublic java.lang.String toXml(StepRegistry registry) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
toXmlpublic void toXml(javax.xml.stream.XMLStreamWriter writer, StepRegistry registry) throws javax.xml.stream.XMLStreamExceptionOutputs this chart UI model to the XML stream. Expects that the <sfc> (or <parallel>) element has already been written.- Throws:
- javax.xml.stream.XMLStreamException
 
 - 
fromXmlpublic static ChartUIModel fromXml(java.io.InputStream xmlInput, StepRegistry registry) throws XmlParseException Parses the input stream as XML which should represent a ChartUIModel- Throws:
- XmlParseException
 
 - 
fromXmlpublic static ChartUIModel fromXml(org.w3c.dom.Element sfcElement, StepRegistry registry) throws XmlParseException - Throws:
- XmlParseException
 
 - 
parseDimensionpublic static java.awt.Dimension parseDimension(java.lang.String attributeValue) 
 - 
fireStructureChangedprotected void fireStructureChanged() 
 - 
fireElementAddedprotected void fireElementAdded(ChartUIElement element) 
 - 
fireElementRemovedprotected void fireElementRemoved(ChartUIElement element) 
 - 
isParallelSectionModelpublic boolean isParallelSectionModel() 
 - 
getParentModelpublic com.google.common.base.Optional<ChartUIModel> getParentModel() 
 - 
getParentModelSerializer@Deprecated public ChartUIModel getParentModelSerializer() Deprecated.Do not call - for serialization
 - 
setParentModelSerializer@Deprecated public void setParentModelSerializer(ChartUIModel parentModel) Deprecated.Do not call - for serialization
 - 
getChartElementspublic java.lang.Iterable<ChartUIElement> getChartElements() Return an iterable view of all chart elements. Note that the iterator generated will be unmodifiable. Also, note that this iterator will be fail-fast, and will throw a ConcurrentModificationException if the model is altered while iterating.
 - 
findpublic com.google.common.base.Optional<ChartUIElement> find(java.util.UUID id) 
 - 
findpublic com.google.common.base.Optional<ChartUIElement> find(int x, int y) 
 - 
findpublic com.google.common.base.Optional<ChartUIElement> find(int x, int y, ElementType type) 
 - 
findElementsAtpublic java.util.List<ChartUIElement> findElementsAt(int x, int y) 
 - 
findParallelBeginspublic java.util.List<ChartUIElement> findParallelBegins() Find the Begin Step elements that start the parallel branches. These elements will not be present in the main elements list within this model, but instead can be accessed through the terminal elements list to be used for serializing and persisting chart instances.
 - 
getConnectivityAtpublic LinkDirection getConnectivityAt(int x, int y, Edge direction) Tests whether the element at the given location is connectable on the given edge, and if so, what direction the connection should be
 - 
getConnectivitypublic static LinkDirection getConnectivity(ChartUIElement element, Edge direction) 
 - 
addChartElementpublic void addChartElement(ChartUIElement element) 
 - 
removeChartElementpublic void removeChartElement(java.util.UUID id) 
 - 
getZoompublic float getZoom() Returns the zoom amount. Standard resolution is 1.0f, zoomed in double is 2.0f, etc.
 - 
setZoompublic void setZoom(float zoom) 
 - 
getCanvasSizepublic java.awt.Dimension getCanvasSize() 
 - 
setCanvasSizepublic void setCanvasSize(java.awt.Dimension canvasSize) 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
getSFCElements@Deprecated public java.util.List<ChartUIElement> getSFCElements() Deprecated.For serialization. do not call.
 - 
setSFCElements@Deprecated public void setSFCElements(java.util.List<ChartUIElement> elements) Deprecated.For serialization. do not call.
 - 
addChartUIModelListenerpublic void addChartUIModelListener(ChartUIModelListener listener) 
 - 
removeChartUIModelListenerpublic void removeChartUIModelListener(ChartUIModelListener listener) 
 - 
addPropertyChangeListenerpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener) 
 - 
removePropertyChangeListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener) 
 - 
addPropertyChangeListenerpublic void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
 - 
removePropertyChangeListenerpublic void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
 - 
getExecutionModepublic ChartExecutionMode getExecutionMode() 
 - 
setExecutionModepublic void setExecutionMode(ChartExecutionMode executionMode) 
 - 
isHotEditablepublic boolean isHotEditable() 
 - 
setHotEditablepublic void setHotEditable(boolean hotEditable) 
 - 
isPersistStatepublic boolean isPersistState() 
 - 
setPersistStatepublic void setPersistState(boolean persistState) 
 - 
isRedundantSyncpublic boolean isRedundantSync() 
 - 
setRedundantSyncpublic void setRedundantSync(boolean redundantSync) - Parameters:
- redundantSync- Set to True to allow a chart's data model to be synchronized between a redundant master and backup during chart state changes and during step transitions.
 
 - 
getOnStartScriptpublic java.lang.String getOnStartScript() 
 - 
setOnStartScriptpublic void setOnStartScript(java.lang.String onStartScript) 
 - 
getOnStopScriptpublic java.lang.String getOnStopScript() 
 - 
setOnStopScriptpublic void setOnStopScript(java.lang.String onStopScript) 
 - 
getOnCancelScriptpublic java.lang.String getOnCancelScript() 
 - 
setOnCancelScriptpublic void setOnCancelScript(java.lang.String onCancelScript) 
 - 
getOnAbortScriptpublic java.lang.String getOnAbortScript() 
 - 
setOnAbortScriptpublic void setOnAbortScript(java.lang.String onAbortScript) 
 - 
getOnRedundantFailoverScriptpublic java.lang.String getOnRedundantFailoverScript() 
 - 
setOnRedundantFailoverScriptpublic void setOnRedundantFailoverScript(java.lang.String onRedundantFailoverScript) - Parameters:
- onRedundantFailoverScript- the script that will fire when a gateway becomes the active node in a redundant cluster
 
 
- 
 
-