Class ChartUIModel
java.lang.Object
com.inductiveautomation.sfc.uimodel.ChartUIModel
This 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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChartUIModel(ChartUIModel parentModel) Creates a chart UI model that is part of a parallel section -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChartElement(ChartUIElement element) voidaddChartUIModelListener(ChartUIModelListener listener) voidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) static ChartUIModelCreates 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>findElementsAt(int x, int y) Find the Begin Step elements that start the parallel branches.protected voidfireElementAdded(ChartUIElement element) protected voidfireElementRemoved(ChartUIElement element) protected voidstatic ChartUIModelfromXml(InputStream xmlInput, StepRegistry registry) Parses the input stream as XML which should represent a ChartUIModelstatic ChartUIModelfromXml(Element sfcElement, StepRegistry registry) Return an iterable view of all chart elements.static LinkDirectiongetConnectivity(ChartUIElement element, Edge direction) 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 becom.google.common.base.Optional<ChartUIModel>Deprecated.Deprecated.floatgetZoom()Returns the zoom amount.inthashCode()booleanbooleanbooleanbooleanstatic DimensionparseDimension(String attributeValue) voidvoidvoidvoidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) voidsetCanvasSize(Dimension canvasSize) voidsetExecutionMode(ChartExecutionMode executionMode) voidsetHotEditable(boolean hotEditable) voidsetOnAbortScript(String onAbortScript) voidsetOnCancelScript(String onCancelScript) voidsetOnRedundantFailoverScript(String onRedundantFailoverScript) voidsetOnStartScript(String onStartScript) voidsetOnStopScript(String onStopScript) voidsetParentModelSerializer(ChartUIModel parentModel) Deprecated.voidsetPersistState(boolean persistState) voidsetRedundantSync(boolean redundantSync) voidsetResourcePath(ResourcePath resourcePath) voidsetSFCElements(List<ChartUIElement> elements) Deprecated.voidsetZoom(float zoom) toXml(StepRegistry registry) voidtoXml(XMLStreamWriter writer, StepRegistry registry) Outputs this chart UI model to the XML stream.
-
Field Details
-
RESOURCE_TYPE
-
RESOURCE_NAME
- See Also:
-
SCOPE
public static final int SCOPE- See Also:
-
-
Constructor Details
-
ChartUIModel
public ChartUIModel() -
ChartUIModel
Creates a chart UI model that is part of a parallel section
-
-
Method Details
-
createNew
Creates a new chart with a begin step at x=5, y=1 -
setResourcePath
-
getResourcePath
-
toXml
- Throws:
Exception
-
toXml
Outputs this chart UI model to the XML stream. Expects that the <sfc> (or <parallel>) element has already been written.- Throws:
XMLStreamException
-
fromXml
public static ChartUIModel fromXml(InputStream xmlInput, StepRegistry registry) throws XmlParseException Parses the input stream as XML which should represent a ChartUIModel- Throws:
XmlParseException
-
fromXml
public static ChartUIModel fromXml(Element sfcElement, StepRegistry registry) throws XmlParseException - Throws:
XmlParseException
-
parseDimension
-
fireStructureChanged
protected void fireStructureChanged() -
fireElementAdded
-
fireElementRemoved
-
isParallelSectionModel
public boolean isParallelSectionModel() -
getParentModel
-
getParentModelSerializer
Deprecated.Do not call - for serialization -
setParentModelSerializer
Deprecated.Do not call - for serialization -
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. -
find
-
find
-
find
-
findElementsAt
-
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. -
getConnectivityAt
Tests whether the element at the given location is connectable on the given edge, and if so, what direction the connection should be -
getConnectivity
-
addChartElement
-
removeChartElement
-
getZoom
public float getZoom()Returns the zoom amount. Standard resolution is 1.0f, zoomed in double is 2.0f, etc. -
setZoom
public void setZoom(float zoom) -
getCanvasSize
-
setCanvasSize
-
hashCode
public int hashCode() -
getSFCElements
Deprecated.For serialization. do not call. -
setSFCElements
Deprecated.For serialization. do not call. -
addChartUIModelListener
-
removeChartUIModelListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
getExecutionMode
-
setExecutionMode
-
isHotEditable
public boolean isHotEditable() -
setHotEditable
public void setHotEditable(boolean hotEditable) -
isPersistState
public boolean isPersistState() -
setPersistState
public void setPersistState(boolean persistState) -
isRedundantSync
public boolean isRedundantSync() -
setRedundantSync
public 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.
-
getOnStartScript
-
setOnStartScript
-
getOnStopScript
-
setOnStopScript
-
getOnCancelScript
-
setOnCancelScript
-
getOnAbortScript
-
setOnAbortScript
-
getOnRedundantFailoverScript
-
setOnRedundantFailoverScript
- Parameters:
onRedundantFailoverScript- the script that will fire when a gateway becomes the active node in a redundant cluster
-