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.StringACHIEVE_GOAL_MODEAchieve Goal Edit Modestatic java.lang.StringACTIVATION_PLAN_MODEActivation Plan Edit Modestatic java.lang.StringCONTROL_POINT_MODEControl Point Modeprotected DeletionControllerdeletioncontrollerThe deletion controllerprotected booleandirtyThe dirty flag.protected AbstractEditingToolbareditingtoolbarThe edit mode tool bar.protected java.io.FilefileThe mode file.protected FoldControllerfoldcontrollerThe fold controllerprotected com.mxgraph.swing.mxGraphComponentgraphcomponentThe graph component.protected ImageProviderimageproviderThe image provider.static java.lang.StringMAINTAIN_GOAL_MODEMaintain Goal Edit Modeprotected IGpmnModelmodelThe current model.protected IGpmnModelFactorymodelfactoryThe model factory.static java.util.Set<java.lang.String>NODE_CREATION_MODESNode Creation Modesstatic java.lang.StringPERFORM_GOAL_MODEPerform Goal Edit Modeprotected java.io.FileprojectrootThe project root.protected javax.swing.JPanelpropertypanelcontainerThe property panel container.static java.lang.StringQUERY_GOAL_MODEQuery Goal Edit Modestatic java.lang.StringREF_PLAN_MODERef Plan Edit Modestatic java.lang.StringSELECT_MODESelect Edit Modestatic java.lang.StringSUPPRESSION_EDGE_MODESuppression 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 booleancheckUnsaved(java.awt.Component parent)Handles unsaved model deletions.voiddesynchModels()Disables deletion controller, desynchronizing visual and business model.protected voidfindProjectRoot()Attempts to find the project root.AbstractEditingToolbargetEditingToolbar()Gets the editing tool bar.java.lang.StringgetEditMode()Gets the edit mode.java.io.FilegetFile()Gets the model file.FoldControllergetFoldController()Returns the controller for folding.IGpmnModelgetGpmnModel()Returns the GPMN intermediate model.GpmnGraphgetGraph()Returns the current visual graph.com.mxgraph.swing.mxGraphComponentgetGraphComponent()Returns the current visual graph component.ImageProvidergetImageProvider()Gets the image provider.IGpmnModelFactorygetModelFactory()Gets the model factory.java.lang.String[]getProjectClasses()Returns all available Java classes in the project.java.io.FilegetProjectRoot()Gets the project root.protected javax.swing.JPanelgetPropertyPanelContainer()Gets the property panel container.booleanisDirty()Tests if the state is dirty.java.util.List<java.lang.String>searchForClasses(java.io.File dir)Recursive search for class files.voidsetDirty(boolean dirty)Sets the dirty model state.voidsetEditingToolbar(AbstractEditingToolbar toolbar)Sets the editing tool bar.voidsetEditMode(java.lang.String editmode)Sets the edit mode.voidsetFile(java.io.File file)Sets the model file.voidsetGpmnModel(IGpmnModel model)Sets the GPMN model.voidsetGraph(GpmnGraph graph)Sets the current visual graph.voidsetGraphComponent(com.mxgraph.swing.mxGraphComponent component)Sets the visual graph component.voidsetModelFactory(IGpmnModelFactory modelfactory)Sets the model factory.voidsetProjectRoot(java.io.File root)Sets the project root.voidsetPropertyPanel(javax.swing.JComponent panel)Sets the current property panel.protected voidsetPropertyPanelContainer(javax.swing.JPanel propertypanelcontainer)Sets the property panel container.voidsynchModels()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.
-
-