Class ModelContainer

  • All Implemented Interfaces:
    IModelContainer

    public class ModelContainer
    extends java.lang.Object
    implements IModelContainer
    Container for the current model.
    • Field Detail

      • EDIT_MODE_SELECTION

        public static final java.lang.String EDIT_MODE_SELECTION
        Edit mode for selection.
        See Also:
        Constant Field Values
      • EDIT_MODE_STEALTH_SELECTION

        public static final java.lang.String EDIT_MODE_STEALTH_SELECTION
        Edit mode for stealth selection.
        See Also:
        Constant Field Values
      • EDIT_MODE_ADD_CONTROL_POINT

        public static final java.lang.String EDIT_MODE_ADD_CONTROL_POINT
        Edit mode for adding control points.
        See Also:
        Constant Field Values
      • EDIT_MODE_MESSAGING_EDGE

        public static final java.lang.String EDIT_MODE_MESSAGING_EDGE
        Edit mode for message edges.
        See Also:
        Constant Field Values
      • EDIT_MODE_POOL

        public static final java.lang.String EDIT_MODE_POOL
        Edit mode for adding pools.
        See Also:
        Constant Field Values
      • EDIT_MODE_LANE

        public static final java.lang.String EDIT_MODE_LANE
        Edit mode for adding lanes.
        See Also:
        Constant Field Values
      • EDIT_MODE_TASK

        public static final java.lang.String EDIT_MODE_TASK
        Edit mode for adding tasks.
        See Also:
        Constant Field Values
      • EDIT_MODE_SUBPROCESS

        public static final java.lang.String EDIT_MODE_SUBPROCESS
        Edit mode for adding tasks.
        See Also:
        Constant Field Values
      • EDIT_MODE_EXTERNAL_SUBPROCESS

        public static final java.lang.String EDIT_MODE_EXTERNAL_SUBPROCESS
        Edit mode for adding tasks.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_SUBPROCESS

        public static final java.lang.String EDIT_MODE_EVENT_SUBPROCESS
        Edit mode for adding tasks.
        See Also:
        Constant Field Values
      • EDIT_MODE_GW_XOR

        public static final java.lang.String EDIT_MODE_GW_XOR
        Edit mode for adding xor-gateways.
        See Also:
        Constant Field Values
      • EDIT_MODE_GW_AND

        public static final java.lang.String EDIT_MODE_GW_AND
        Edit mode for adding and-gateways.
        See Also:
        Constant Field Values
      • EDIT_MODE_GW_OR

        public static final java.lang.String EDIT_MODE_GW_OR
        Edit mode for adding or-gateways.
        See Also:
        Constant Field Values
      • THROWING_EVENT

        public static final java.lang.String THROWING_EVENT
        Flag for throwing events
        See Also:
        Constant Field Values
      • BOUNDARY_EVENT

        public static final java.lang.String BOUNDARY_EVENT
        Flag for boundary events
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_START_EMPTY

        public static final java.lang.String EDIT_MODE_EVENT_START_EMPTY
        Edit mode for adding empty start events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_EMPTY

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_EMPTY
        Edit mode for adding empty intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_ERROR

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_ERROR
        Edit mode for adding error intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_EMPTY

        public static final java.lang.String EDIT_MODE_EVENT_END_EMPTY
        Edit mode for adding empty end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_START_MESSAGE

        public static final java.lang.String EDIT_MODE_EVENT_START_MESSAGE
        Edit mode for adding message start events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_MESSAGE

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_MESSAGE
        Edit mode for adding message intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_MESSAGE_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_MESSAGE_THROWING
        Edit mode for adding throwing message intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_MESSAGE

        public static final java.lang.String EDIT_MODE_EVENT_END_MESSAGE
        Edit mode for adding message end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_MESSAGE_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_END_MESSAGE_THROWING
        Edit mode for adding throwing message end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_START_TIMER

        public static final java.lang.String EDIT_MODE_EVENT_START_TIMER
        Edit mode for adding timer start events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_TIMER

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_TIMER
        Edit mode for adding timer intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_START_RULE

        public static final java.lang.String EDIT_MODE_EVENT_START_RULE
        Edit mode for adding rule start events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_RULE

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_RULE
        Edit mode for adding rule intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_START_SIGNAL

        public static final java.lang.String EDIT_MODE_EVENT_START_SIGNAL
        Edit mode for adding signal start events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_SIGNAL

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_SIGNAL
        Edit mode for adding signal intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_SIGNAL_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_SIGNAL_THROWING
        Edit mode for adding throwing signal intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_SIGNAL

        public static final java.lang.String EDIT_MODE_EVENT_END_SIGNAL
        Edit mode for adding signal end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_SIGNAL_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_END_SIGNAL_THROWING
        Edit mode for adding throwing signal end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_ERROR_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_END_ERROR_THROWING
        Edit mode for adding error end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_COMPENSATION_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_END_COMPENSATION_THROWING
        Edit mode for adding compensation end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_CANCEL_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_END_CANCEL_THROWING
        Edit mode for adding compensation end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_END_TERMINATE_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_END_TERMINATE_THROWING
        Edit mode for adding terminate end events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_START_MULTIPLE

        public static final java.lang.String EDIT_MODE_EVENT_START_MULTIPLE
        Edit mode for adding multiple start events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_MULTIPLE

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_MULTIPLE
        Edit mode for adding rule intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_INTERMEDIATE_MULTIPLE_THROWING

        public static final java.lang.String EDIT_MODE_EVENT_INTERMEDIATE_MULTIPLE_THROWING
        Edit mode for adding rule intermediate events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_BOUNDARY_ERROR

        public static final java.lang.String EDIT_MODE_EVENT_BOUNDARY_ERROR
        Edit mode for adding error boundary events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_BOUNDARY_MESSAGE

        public static final java.lang.String EDIT_MODE_EVENT_BOUNDARY_MESSAGE
        Edit mode for adding message boundary events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_BOUNDARY_TIMER

        public static final java.lang.String EDIT_MODE_EVENT_BOUNDARY_TIMER
        Edit mode for adding timer boundary events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_BOUNDARY_COMPENSATION

        public static final java.lang.String EDIT_MODE_EVENT_BOUNDARY_COMPENSATION
        Edit mode for adding compensation boundary events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_BOUNDARY_CANCEL

        public static final java.lang.String EDIT_MODE_EVENT_BOUNDARY_CANCEL
        Edit mode for adding cancellation boundary events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_BOUNDARY_RULE

        public static final java.lang.String EDIT_MODE_EVENT_BOUNDARY_RULE
        Edit mode for adding rule boundary events.
        See Also:
        Constant Field Values
      • EDIT_MODE_EVENT_BOUNDARY_SIGNAL

        public static final java.lang.String EDIT_MODE_EVENT_BOUNDARY_SIGNAL
        Edit mode for adding signal boundary events.
        See Also:
        Constant Field Values
      • ACTIVITY_MODES

        public static final java.util.Set<java.lang.String> ACTIVITY_MODES
        Modes for adding activities.
      • ACTIVITY_MODES_TO_TYPES

        public static final java.util.Map<java.lang.String,​java.lang.String> ACTIVITY_MODES_TO_TYPES
        Mapping activity edit modes to activity types
      • settings

        protected Settings settings
        The global settings.
      • file

        protected java.io.File file
        The model file.
      • graphcomponent

        protected com.mxgraph.swing.mxGraphComponent graphcomponent
        The graph component.
      • graph

        protected BpmnGraph graph
        The graph (visual model)
      • model

        protected MBpmnModel model
        The current model.
      • dirty

        protected boolean dirty
        The dirty flag.
      • projectroot

        protected java.io.File projectroot
        The project root.
      • classloaderroot

        protected java.io.File classloaderroot
        The class loader root.
      • projecttaskmetainfos

        protected java.util.Map<java.lang.String,​TaskMetaInfo> projecttaskmetainfos
        The infos of tasks in the project.
      • propertypanelcontainer

        protected javax.swing.JPanel propertypanelcontainer
        The property panel container.
      • changelisteners

        protected java.util.List<javax.swing.event.ChangeListener> changelisteners
        The change listeners.
      • taskclasses

        protected volatile java.util.List<ClassInfo> taskclasses
        The task classes.
      • interclasses

        protected volatile java.util.List<ClassInfo> interclasses
        The interface classes.
      • exceptionclasses

        protected volatile java.util.List<ClassInfo> exceptionclasses
        The exception classes.
      • allclasses

        protected volatile java.util.List<ClassInfo> allclasses
        The all classes.
    • Constructor Detail

      • ModelContainer

        public ModelContainer​(Settings settings)
        Creates a new container.
    • Method Detail

      • getExceptions

        public java.util.List<ClassInfo> getExceptions()
        Gets the exceptions.
        Returns:
        The exceptions.
      • getIdGenerator

        public IdGenerator getIdGenerator()
        Returns the ID generator.
        Returns:
        The id generator.
      • getGraphComponent

        public com.mxgraph.swing.mxGraphComponent getGraphComponent()
        Returns the current visual graph component.
        Returns:
        The graph.
      • getGraph

        public BpmnGraph getGraph()
        Returns the current visual graph.
        Returns:
        The graph.
      • setGraph

        public void setGraph​(BpmnGraph graph)
        Sets the current visual graph.
        Parameters:
        graph - The graph.
      • setGraphComponent

        public void setGraphComponent​(com.mxgraph.swing.mxGraphComponent component)
        Sets the visual graph component.
        Parameters:
        component - The component.
      • setBpmnModel

        public void setBpmnModel​(MBpmnModel model)
        Sets the GPMN model.
        Parameters:
        model - The model.
      • setDirty

        public void setDirty​(boolean dirty)
        Sets the dirty model state.
        Specified by:
        setDirty in interface IModelContainer
        Parameters:
        dirty - The dirty state.
      • isDirty

        public boolean isDirty()
        Tests if the state is dirty.
        Specified by:
        isDirty in interface IModelContainer
        Returns:
        True, if dirty.
      • getProjectRoot

        public java.io.File getProjectRoot()
        Gets the project root.
        Specified by:
        getProjectRoot in interface IModelContainer
        Returns:
        The project root.
      • setProjectRoot

        public void setProjectRoot​(java.io.File root)
        Sets the project root.
        Parameters:
        root - The project root.
      • getProjectClassLoaderRoot

        public java.io.File getProjectClassLoaderRoot()
        Returns the root for the project class loader.
        Specified by:
        getProjectClassLoaderRoot in interface IModelContainer
        Returns:
        The root of the project class loader.
      • getSettings

        public Settings getSettings()
        Gets the global settings.
        Returns:
        The settings
      • getFile

        public java.io.File getFile()
        Gets the model file.
        Specified by:
        getFile in interface IModelContainer
        Returns:
        The model file.
      • setFile

        public void setFile​(java.io.File file)
        Sets the model file.
        Parameters:
        file - The model file.
      • getProjectClassLoader

        public java.lang.ClassLoader getProjectClassLoader()
        Gets the project class loader.
        Specified by:
        getProjectClassLoader in interface IModelContainer
        Returns:
        The project class loader.
      • getEditMode

        public java.lang.String getEditMode()
        Gets the edit mode.
        Specified by:
        getEditMode in interface IModelContainer
        Returns:
        The edit mode.
      • setEditMode

        public void setEditMode​(java.lang.String editmode)
        Sets the edit mode.
        Parameters:
        editmode - The edit mode.
      • getEditingToolbar

        public AbstractEditingToolbar getEditingToolbar()
        Gets the editing tool bar.
        Returns:
        The editing tool bar.
      • setEditingToolbar

        public void setEditingToolbar​(AbstractEditingToolbar toolbar)
        Sets the editing tool bar.
        Parameters:
        toolbar - The editing tool bar.
      • setPropertyPanel

        public void setPropertyPanel​(javax.swing.JComponent panel)
        Sets the current property panel.
        Parameters:
        panel - The panel.
      • getPropertyPanel

        public javax.swing.JComponent getPropertyPanel()
        Gets the current property panel.
        Returns:
        The panel.
      • getPropertypanelcontainer

        public javax.swing.JPanel getPropertypanelcontainer()
        Gets the property panel container.
        Specified by:
        getPropertypanelcontainer in interface IModelContainer
        Returns:
        The property panel container.
      • setPropertypanelcontainer

        public void setPropertypanelcontainer​(javax.swing.JPanel propertypanelcontainer)
        Sets the property panel container.
        Parameters:
        propertypanelcontainer - The property panel container.
      • checkUnsaved

        public boolean checkUnsaved​(java.awt.Component parent)
        Handles unsaved model deletions.
        Parameters:
        parent - Parent component.
        modelcontainer - The model container.
      • findProjectRoot

        protected void findProjectRoot()
        Attempts to find the project root.
      • addChangeListener

        public void addChangeListener​(javax.swing.event.ChangeListener listener)
        Adds a change listener. Currently only reports dirty events.
        Specified by:
        addChangeListener in interface IModelContainer
        Parameters:
        listener - The listener.
      • generateClassLoader

        public void generateClassLoader()
        Generates the class loader.
      • setupClassInfos

        protected void setupClassInfos()
      • fireChangeEvent

        protected void fireChangeEvent​(javax.swing.event.ChangeEvent e)
        Fires a change event.
        Parameters:
        e - The event.
      • getParameterNames

        public java.util.List<java.lang.String> getParameterNames​(java.lang.reflect.Method m)
        Get parameter names of a method.
        Specified by:
        getParameterNames in interface IModelContainer
      • getReturnValueName

        public java.lang.String getReturnValueName​(java.lang.reflect.Method m)
        Get return value name.
        Specified by:
        getReturnValueName in interface IModelContainer