From 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 4 Aug 2011 00:42:34 +0200 Subject: More code cleanup: Refactored Entity Proxy Subscription to handle generics better Rewrote RemoteMap to use TreeMap instead of the internal array for order. It now sorts its keys by number if they parse, else as strings. Removed a no-longer-in-progress outcome form class --- .../gui/view/ElemActDefOutcomeHandler.java | 53 +++++++++++++--------- 1 file changed, 31 insertions(+), 22 deletions(-) mode change 100755 => 100644 source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java (limited to 'source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java') diff --git a/source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java b/source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java old mode 100755 new mode 100644 index a30491e..c37e5a7 --- a/source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java +++ b/source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java @@ -41,7 +41,8 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out /** * */ - public void setOutcome(String outcome) throws InvalidOutcomeException { + @Override + public void setOutcome(String outcome) throws InvalidOutcomeException { try { act = (ActivityDef)CastorXMLUtility.unmarshall(outcome); setVertex(act); @@ -54,7 +55,8 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out /** * */ - public void setDescription(String description) + @Override + public void setDescription(String description) throws InvalidSchemaException { // ignore } @@ -62,7 +64,8 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out /** * */ - public void setReadOnly(boolean readOnly) { + @Override + public void setReadOnly(boolean readOnly) { setEditable(!readOnly); } @@ -70,48 +73,54 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out /** * */ - 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(act); } catch (Exception ex) { Logger.error(ex); throw new OutcomeException(); - } + } } /** * */ - public void run() { + @Override + public void run() { validate(); } - - 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 { exportAct(targetFile.getParentFile(), act); } - + public static void exportAct(File dir, ActivityDef actDef) throws Exception { FileStringUtility.string2File(new File(dir, actDef.getActName()+".xml"), CastorXMLUtility.marshall(actDef)); // Export associated schema exportSchema((String)actDef.getProperties().get("SchemaType"), (String)actDef.getProperties().get("SchemaVersion"), dir); // Export associated script exportScript((String)actDef.getProperties().get("ScriptName"), (String)actDef.getProperties().get("ScriptVersion"), dir); - + //Export child act if composite if (actDef instanceof CompositeActivityDef) { CompositeActivityDef compActDef = (CompositeActivityDef)actDef; @@ -121,32 +130,32 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out exportScript((String)vert.getProperties().get("RoutingScriptName"), (String)vert.getProperties().get("RoutingScriptVersion"), dir); } GraphableVertex[] childDefs = compActDef.getLayoutableChildren(); - for (int i=0; i