Package jadex.gpmn.editor.gui
Class ModelContainer
- java.lang.Object
-
- jadex.gpmn.editor.gui.ModelContainer
-
public class ModelContainer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACHIEVE_GOAL_MODE
Achieve Goal Edit Modestatic java.lang.String
ACTIVATION_PLAN_MODE
Activation Plan Edit Modestatic java.lang.String
CONTROL_POINT_MODE
Control Point Modeprotected DeletionController
deletioncontroller
The deletion controllerprotected boolean
dirty
The dirty flag.protected AbstractEditingToolbar
editingtoolbar
The edit mode tool bar.protected java.io.File
file
The mode file.protected FoldController
foldcontroller
The fold controllerprotected com.mxgraph.swing.mxGraphComponent
graphcomponent
The graph component.protected ImageProvider
imageprovider
The image provider.static java.lang.String
MAINTAIN_GOAL_MODE
Maintain Goal Edit Modeprotected IGpmnModel
model
The current model.protected IGpmnModelFactory
modelfactory
The model factory.static java.util.Set<java.lang.String>
NODE_CREATION_MODES
Node Creation Modesstatic java.lang.String
PERFORM_GOAL_MODE
Perform Goal Edit Modeprotected java.io.File
projectroot
The project root.protected javax.swing.JPanel
propertypanelcontainer
The property panel container.static java.lang.String
QUERY_GOAL_MODE
Query Goal Edit Modestatic java.lang.String
REF_PLAN_MODE
Ref Plan Edit Modestatic java.lang.String
SELECT_MODE
Select Edit Modestatic java.lang.String
SUPPRESSION_EDGE_MODE
Suppression Edge Edit Mode
-
Constructor Summary
Constructors Constructor Description ModelContainer(IGpmnModelFactory modelfactory, com.mxgraph.swing.mxGraphComponent graphcomponent, IGpmnModel model)
Creates a new container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkUnsaved(java.awt.Component parent)
Handles unsaved model deletions.void
desynchModels()
Disables deletion controller, desynchronizing visual and business model.protected void
findProjectRoot()
Attempts to find the project root.AbstractEditingToolbar
getEditingToolbar()
Gets the editing tool bar.java.lang.String
getEditMode()
Gets the edit mode.java.io.File
getFile()
Gets the model file.FoldController
getFoldController()
Returns the controller for folding.IGpmnModel
getGpmnModel()
Returns the GPMN intermediate model.GpmnGraph
getGraph()
Returns the current visual graph.com.mxgraph.swing.mxGraphComponent
getGraphComponent()
Returns the current visual graph component.ImageProvider
getImageProvider()
Gets the image provider.IGpmnModelFactory
getModelFactory()
Gets the model factory.java.lang.String[]
getProjectClasses()
Returns all available Java classes in the project.java.io.File
getProjectRoot()
Gets the project root.protected javax.swing.JPanel
getPropertyPanelContainer()
Gets the property panel container.boolean
isDirty()
Tests if the state is dirty.java.util.List<java.lang.String>
searchForClasses(java.io.File dir)
Recursive search for class files.void
setDirty(boolean dirty)
Sets the dirty model state.void
setEditingToolbar(AbstractEditingToolbar toolbar)
Sets the editing tool bar.void
setEditMode(java.lang.String editmode)
Sets the edit mode.void
setFile(java.io.File file)
Sets the model file.void
setGpmnModel(IGpmnModel model)
Sets the GPMN model.void
setGraph(GpmnGraph graph)
Sets the current visual graph.void
setGraphComponent(com.mxgraph.swing.mxGraphComponent component)
Sets the visual graph component.void
setModelFactory(IGpmnModelFactory modelfactory)
Sets the model factory.void
setProjectRoot(java.io.File root)
Sets the project root.void
setPropertyPanel(javax.swing.JComponent panel)
Sets the current property panel.protected void
setPropertyPanelContainer(javax.swing.JPanel propertypanelcontainer)
Sets the property panel container.void
synchModels()
Enables deletion controller, synchronizing visual and business model.
-
-
-
Field Detail
-
SELECT_MODE
public static final java.lang.String SELECT_MODE
Select Edit Mode- See Also:
- Constant Field Values
-
CONTROL_POINT_MODE
public static final java.lang.String CONTROL_POINT_MODE
Control Point Mode- See Also:
- Constant Field Values
-
ACHIEVE_GOAL_MODE
public static final java.lang.String ACHIEVE_GOAL_MODE
Achieve Goal Edit Mode- See Also:
- Constant Field Values
-
PERFORM_GOAL_MODE
public static final java.lang.String PERFORM_GOAL_MODE
Perform Goal Edit Mode- See Also:
- Constant Field Values
-
MAINTAIN_GOAL_MODE
public static final java.lang.String MAINTAIN_GOAL_MODE
Maintain Goal Edit Mode- See Also:
- Constant Field Values
-
QUERY_GOAL_MODE
public static final java.lang.String QUERY_GOAL_MODE
Query Goal Edit Mode- See Also:
- Constant Field Values
-
REF_PLAN_MODE
public static final java.lang.String REF_PLAN_MODE
Ref Plan Edit Mode- See Also:
- Constant Field Values
-
ACTIVATION_PLAN_MODE
public static final java.lang.String ACTIVATION_PLAN_MODE
Activation Plan Edit Mode- See Also:
- Constant Field Values
-
SUPPRESSION_EDGE_MODE
public static final java.lang.String SUPPRESSION_EDGE_MODE
Suppression Edge Edit Mode- See Also:
- Constant Field Values
-
NODE_CREATION_MODES
public static final java.util.Set<java.lang.String> NODE_CREATION_MODES
Node Creation Modes
-
file
protected java.io.File file
The mode file.
-
graphcomponent
protected com.mxgraph.swing.mxGraphComponent graphcomponent
The graph component.
-
model
protected IGpmnModel model
The current model.
-
editingtoolbar
protected AbstractEditingToolbar editingtoolbar
The edit mode tool bar.
-
dirty
protected boolean dirty
The dirty flag.
-
projectroot
protected java.io.File projectroot
The project root.
-
modelfactory
protected IGpmnModelFactory modelfactory
The model factory.
-
imageprovider
protected ImageProvider imageprovider
The image provider.
-
propertypanelcontainer
protected javax.swing.JPanel propertypanelcontainer
The property panel container.
-
deletioncontroller
protected DeletionController deletioncontroller
The deletion controller
-
foldcontroller
protected FoldController foldcontroller
The fold controller
-
-
Constructor Detail
-
ModelContainer
public ModelContainer(IGpmnModelFactory modelfactory, com.mxgraph.swing.mxGraphComponent graphcomponent, IGpmnModel model)
Creates a new container.
-
-
Method Detail
-
getGraphComponent
public com.mxgraph.swing.mxGraphComponent getGraphComponent()
Returns the current visual graph component.- Returns:
- The graph.
-
getGraph
public GpmnGraph getGraph()
Returns the current visual graph.- Returns:
- The graph.
-
getGpmnModel
public IGpmnModel getGpmnModel()
Returns the GPMN intermediate model.- Returns:
- GPMN model.
-
setGraph
public void setGraph(GpmnGraph 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.
-
setGpmnModel
public void setGpmnModel(IGpmnModel model)
Sets the GPMN model.- Parameters:
model
- The model.
-
getModelFactory
public IGpmnModelFactory getModelFactory()
Gets the model factory.- Returns:
- The model factory.
-
setModelFactory
public void setModelFactory(IGpmnModelFactory modelfactory)
Sets the model factory.- Parameters:
modelfactory
- The model factory.
-
getImageProvider
public ImageProvider getImageProvider()
Gets the image provider.- Returns:
- The image provider.
-
getEditMode
public java.lang.String getEditMode()
Gets the edit mode.- 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.
-
getFoldController
public FoldController getFoldController()
Returns the controller for folding.- Returns:
- Fold controller.
-
desynchModels
public void desynchModels()
Disables deletion controller, desynchronizing visual and business model.
-
synchModels
public void synchModels()
Enables deletion controller, synchronizing visual and business model.
-
setDirty
public void setDirty(boolean dirty)
Sets the dirty model state.- Parameters:
dirty
- The dirty state.
-
isDirty
public boolean isDirty()
Tests if the state is dirty.- Returns:
- True, if dirty.
-
checkUnsaved
public boolean checkUnsaved(java.awt.Component parent)
Handles unsaved model deletions.- Parameters:
parent
- Parent component.modelcontainer
- The model container.
-
getPropertyPanelContainer
protected javax.swing.JPanel getPropertyPanelContainer()
Gets the property panel container.- Returns:
- The property panel container.
-
setPropertyPanelContainer
protected void setPropertyPanelContainer(javax.swing.JPanel propertypanelcontainer)
Sets the property panel container.- Parameters:
propertypanelcontainer
- The property panel container.
-
getProjectRoot
public java.io.File getProjectRoot()
Gets the project root.- Returns:
- The project root.
-
setProjectRoot
public void setProjectRoot(java.io.File root)
Sets the project root.- Parameters:
root
- The project root.
-
getFile
public java.io.File getFile()
Gets the model file.- Returns:
- The model file.
-
setFile
public void setFile(java.io.File file)
Sets the model file.- Parameters:
file
- The model file.
-
getProjectClasses
public java.lang.String[] getProjectClasses()
Returns all available Java classes in the project.- Returns:
- Array of class names, null if unknown.
-
searchForClasses
public java.util.List<java.lang.String> searchForClasses(java.io.File dir)
Recursive search for class files.
-
findProjectRoot
protected void findProjectRoot()
Attempts to find the project root.
-
-