Class ChartUIModel


  • public class ChartUIModel
    extends java.lang.Object
    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.
    • Constructor Detail

      • ChartUIModel

        public ChartUIModel()
      • ChartUIModel

        public ChartUIModel​(ChartUIModel parentModel)
        Creates a chart UI model that is part of a parallel section
    • Method Detail

      • createNew

        public static ChartUIModel createNew()
        Creates a new chart with a begin step at x=5, y=1
      • toXml

        public java.lang.String toXml​(StepRegistry registry)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • toXml

        public void toXml​(javax.xml.stream.XMLStreamWriter writer,
                          StepRegistry registry)
                   throws javax.xml.stream.XMLStreamException
        Outputs this chart UI model to the XML stream. Expects that the <sfc> (or <parallel>) element has already been written.
        Throws:
        javax.xml.stream.XMLStreamException
      • parseDimension

        public static java.awt.Dimension parseDimension​(java.lang.String attributeValue)
      • fireStructureChanged

        protected void fireStructureChanged()
      • fireElementAdded

        protected void fireElementAdded​(ChartUIElement element)
      • fireElementRemoved

        protected void fireElementRemoved​(ChartUIElement element)
      • isParallelSectionModel

        public boolean isParallelSectionModel()
      • getParentModel

        public 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
      • getChartElements

        public 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.
      • find

        public com.google.common.base.Optional<ChartUIElement> find​(java.util.UUID id)
      • find

        public com.google.common.base.Optional<ChartUIElement> find​(int x,
                                                                    int y)
      • findElementsAt

        public java.util.List<ChartUIElement> findElementsAt​(int x,
                                                             int y)
      • findParallelBegins

        public java.util.List<ChartUIElement> findParallelBegins()
        Find the elements that start the parallel branches. Note that these elements will be Begin Steps, although they won't actually be present in the list of elements present in this model. And their ID will change with every call to this function.
      • getConnectivityAt

        public 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
      • addChartElement

        public void addChartElement​(ChartUIElement element)
      • removeChartElement

        public void removeChartElement​(java.util.UUID id)
      • 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

        public java.awt.Dimension getCanvasSize()
      • setCanvasSize

        public void setCanvasSize​(java.awt.Dimension canvasSize)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in 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.
      • removeChartUIModelListener

        public void removeChartUIModelListener​(ChartUIModelListener listener)
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
      • removePropertyChangeListener

        public void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.lang.String propertyName,
                                              java.beans.PropertyChangeListener listener)
      • removePropertyChangeListener

        public void removePropertyChangeListener​(java.lang.String propertyName,
                                                 java.beans.PropertyChangeListener listener)
      • 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

        public java.lang.String getOnStartScript()
      • setOnStartScript

        public void setOnStartScript​(java.lang.String onStartScript)
      • getOnStopScript

        public java.lang.String getOnStopScript()
      • setOnStopScript

        public void setOnStopScript​(java.lang.String onStopScript)
      • getOnCancelScript

        public java.lang.String getOnCancelScript()
      • setOnCancelScript

        public void setOnCancelScript​(java.lang.String onCancelScript)
      • getOnAbortScript

        public java.lang.String getOnAbortScript()
      • setOnAbortScript

        public void setOnAbortScript​(java.lang.String onAbortScript)
      • getOnRedundantFailoverScript

        public java.lang.String getOnRedundantFailoverScript()
      • setOnRedundantFailoverScript

        public void setOnRedundantFailoverScript​(java.lang.String onRedundantFailoverScript)
        Parameters:
        onRedundantFailoverScript - the script that will fire when a gateway becomes the active node in a redundant cluster