diff options
Diffstat (limited to 'source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java')
| -rw-r--r--[-rwxr-xr-x] | source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java | 79 |
1 files changed, 47 insertions, 32 deletions
diff --git a/source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java b/source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java index cb0ef59..58964aa 100755..100644 --- a/source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java +++ b/source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java @@ -15,7 +15,11 @@ import com.c2kernel.graph.layout.DefaultGraphLayoutGenerator; import com.c2kernel.graph.view.EditorPanel;
import com.c2kernel.graph.view.VertexPropertyPanel;
import com.c2kernel.gui.MainFrame;
-import com.c2kernel.gui.tabs.outcome.*;
+import com.c2kernel.gui.tabs.outcome.InvalidOutcomeException;
+import com.c2kernel.gui.tabs.outcome.InvalidSchemaException;
+import com.c2kernel.gui.tabs.outcome.OutcomeException;
+import com.c2kernel.gui.tabs.outcome.OutcomeHandler;
+import com.c2kernel.gui.tabs.outcome.OutcomeNotInitialisedException;
import com.c2kernel.lifecycle.CompositeActivityDef;
import com.c2kernel.lifecycle.gui.model.WfDefGraphPanel;
import com.c2kernel.lifecycle.gui.model.WfEdgeDefFactory;
@@ -44,26 +48,26 @@ public class CompActDefOutcomeHandler protected JButton mLoadButton = new JButton(Resource.getImageResource("graph/load.png"));
protected JButton mLayoutButton = new JButton(Resource.getImageResource("graph/autolayout.png"));
protected JButton[] mOtherToolBarButtons = { mLayoutButton, mLoadButton };
-
+
protected CompositeActivityDef mCompActDef = null;
protected WfEdgeDefFactory mWfEdgeDefFactory = new WfEdgeDefFactory();
- protected WfVertexDefFactory mWfVertexDefFactory = new WfVertexDefFactory();
+ protected WfVertexDefFactory mWfVertexDefFactory = new WfVertexDefFactory();
protected EditorPanel mEditorPanel;
protected VertexPropertyPanel mPropertyPanel;
protected JSplitPane mSplitPane;
boolean unsaved;
-
+
public CompActDefOutcomeHandler() {
super();
- mPropertyPanel = loadPropertyPanel();
- mPropertyPanel.createLayout(new FindActDefPanel());
+ mPropertyPanel = loadPropertyPanel();
+ mPropertyPanel.createLayout(new FindActDefPanel());
mEditorPanel =
new EditorPanel(
mWfEdgeDefFactory,
mWfVertexDefFactory,
new WfVertexDefOutlineCreator(),
- true,
+ true,
mOtherToolBarButtons,
new WfDefGraphPanel(new WfDirectedEdgeDefRenderer(),
new WfVertexDefRenderer()));
@@ -92,7 +96,8 @@ public class CompActDefOutcomeHandler protected void createListeners()
{
mLoadButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
+ @Override
+ public void actionPerformed(ActionEvent ae) {
File selectedFile = null;
int returnValue = MainFrame.xmlChooser.showOpenDialog(null);
@@ -110,32 +115,34 @@ public class CompActDefOutcomeHandler }
case JFileChooser.CANCEL_OPTION :
case JFileChooser.ERROR_OPTION :
-
+
default :
}
}
});
-
+
mLayoutButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
+ @Override
+ public void actionPerformed(ActionEvent ae) {
DefaultGraphLayoutGenerator.layoutGraph(mEditorPanel.mGraphModelManager.getModel());
}
});
- }
-
+ }
+
public void setUpGraphEditor() {
mEditorPanel.mGraphModelManager.setModel(mCompActDef.getChildrenGraphModel());
// Give the editor panel the edge and vertex types
mEditorPanel.updateVertexTypes(mCompActDef.getVertexTypeNameAndConstructionInfo());
mEditorPanel.updateEdgeTypes(mCompActDef.getEdgeTypeNameAndConstructionInfo());
mEditorPanel.enterSelectMode();
- mWfVertexDefFactory.setCreationContext(mCompActDef);
+ mWfVertexDefFactory.setCreationContext(mCompActDef);
}
-
+
/**
*
*/
- public void setOutcome(String outcome) throws InvalidOutcomeException {
+ @Override
+ public void setOutcome(String outcome) throws InvalidOutcomeException {
try {
CompositeActivityDef newAct = (CompositeActivityDef)CastorXMLUtility.unmarshall(outcome);
if (mCompActDef != null)
@@ -149,14 +156,16 @@ public class CompActDefOutcomeHandler /**
*
*/
- public void setDescription(String description)
+ @Override
+ public void setDescription(String description)
throws InvalidSchemaException {
- // ignore - always the same
+ // ignore - always the same
}
/**
*
*/
- public void setReadOnly(boolean readOnly) {
+ @Override
+ public void setReadOnly(boolean readOnly) {
mLayoutButton.setEnabled(!readOnly);
mLoadButton.setEnabled(!readOnly);
mEditorPanel.setEditable(!readOnly);
@@ -165,13 +174,15 @@ public class CompActDefOutcomeHandler /**
*
*/
- public JPanel getPanel() throws OutcomeNotInitialisedException {
+ @Override
+ public JPanel getPanel() throws OutcomeNotInitialisedException {
return this;
}
/**
*
*/
- public String getOutcome() throws OutcomeException {
+ @Override
+ public String getOutcome() throws OutcomeException {
try {
return CastorXMLUtility.marshall(mCompActDef);
} catch (Exception ex) {
@@ -181,20 +192,21 @@ public class CompActDefOutcomeHandler /**
*
*/
- public void run() {
- Thread.currentThread().setName("Composite Act Def Viewer");
+ @Override
+ public void run() {
+ Thread.currentThread().setName("Composite Act Def Viewer");
createLayout();
createListeners();
- mPropertyPanel.setGraphModelManager(mEditorPanel.mGraphModelManager);
- setUpGraphEditor();
+ mPropertyPanel.setGraphModelManager(mEditorPanel.mGraphModelManager);
+ setUpGraphEditor();
}
-
+
public VertexPropertyPanel loadPropertyPanel()
{
String wfPanelClass = Gateway.getProperty("WfPropertyPanel");
if (wfPanelClass != null) {
try {
- Class panelClass = Class.forName(wfPanelClass);
+ Class<?> panelClass = Class.forName(wfPanelClass);
return (VertexPropertyPanel)panelClass.newInstance();
} catch (Exception ex) {
Logger.error("Could not load wf props panel:"+wfPanelClass);
@@ -203,15 +215,18 @@ public class CompActDefOutcomeHandler }
return new VertexPropertyPanel();
}
-
- public boolean isUnsaved() {
+
+ @Override
+ public boolean isUnsaved() {
return unsaved;
}
-
- public void saved() {
+
+ @Override
+ public void saved() {
unsaved = false;
}
-
+
+ @Override
public void export(File targetFile) throws Exception {
ElemActDefOutcomeHandler.exportAct(targetFile.getParentFile(), mCompActDef);
}
|
