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 TypeMethodDescriptionvoid
addChartElement
(ChartUIElement element) void
addChartUIModelListener
(ChartUIModelListener listener) void
void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) static ChartUIModel
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>
findElementsAt
(int x, int y) Find the Begin Step elements that start the parallel branches.protected void
fireElementAdded
(ChartUIElement element) protected void
fireElementRemoved
(ChartUIElement element) protected void
static ChartUIModel
fromXml
(InputStream xmlInput, StepRegistry registry) Parses the input stream as XML which should represent a ChartUIModelstatic ChartUIModel
fromXml
(Element sfcElement, StepRegistry registry) Return an iterable view of all chart elements.static LinkDirection
getConnectivity
(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.float
getZoom()
Returns the zoom amount.int
hashCode()
boolean
boolean
boolean
boolean
static Dimension
parseDimension
(String attributeValue) void
void
void
void
removePropertyChangeListener
(String propertyName, PropertyChangeListener listener) void
setCanvasSize
(Dimension canvasSize) void
setExecutionMode
(ChartExecutionMode executionMode) void
setHotEditable
(boolean hotEditable) void
setOnAbortScript
(String onAbortScript) void
setOnCancelScript
(String onCancelScript) void
setOnRedundantFailoverScript
(String onRedundantFailoverScript) void
setOnStartScript
(String onStartScript) void
setOnStopScript
(String onStopScript) void
setParentModelSerializer
(ChartUIModel parentModel) Deprecated.void
setPersistState
(boolean persistState) void
setRedundantSync
(boolean redundantSync) void
setResourcePath
(ResourcePath resourcePath) void
setSFCElements
(List<ChartUIElement> elements) Deprecated.void
setZoom
(float zoom) toXml
(StepRegistry registry) void
toXml
(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
-