1 10 11 package org.enhydra.jawe.graph; 12 13 import org.enhydra.jawe.*; 14 import org.enhydra.jawe.xml.*; 15 import org.jgraph.graph.*; 16 17 import java.util.*; 18 import java.awt.*; 19 import javax.swing.*; 20 21 22 26 public class BlockActivity extends Activity { 27 28 protected transient ProcessEditor pEditor; 29 33 protected transient BlockActivityEditor baEditor=null; 34 35 38 public BlockActivity(ProcessEditor pEd) { 39 this(null,pEd); 40 } 41 42 45 public BlockActivity(Object userObject,ProcessEditor pEd) { 46 super(userObject); 47 this.pEditor=pEd; 48 } 49 50 public ProcessEditor getImplementationEditor () { 51 return baEditor; 52 } 53 54 public String getBlockID () { 55 String blockID=((org.enhydra.jawe.xml.elements.Activity) 56 userObject).getBlockActivity().get("BlockId").toString(); 57 return blockID; 58 } 59 60 63 public void showBlockActivity (Window parentWindow) { 64 String baTitle="'"+toString()+"' - "+ 65 ResourceManager.getLanguageDependentString("DialogBlockActivityDefinition"); 66 if (baEditor == null) { 67 org.enhydra.jawe.xml.elements.WorkflowProcess wp=((org.enhydra.jawe.xml.elements.Activity)userObject).getOwnerProcess(); 68 baEditor=new BlockActivityEditor(parentWindow,wp,this,pEditor); 69 baEditor.getStatusBar().updateMessage(); 70 baEditor.showWindow(parentWindow,baTitle); 71 } 72 else { 73 if (baEditor.getGraph().getXPDLObject()!=null) { 76 baEditor.getStatusBar().updateMessage(); 77 baEditor.showWindow(parentWindow,baTitle); 78 } 79 } 80 } 81 82 public void createBlockActivityGraph (Window parentWindow) { 83 org.enhydra.jawe.xml.elements.WorkflowProcess wp= 85 ((org.enhydra.jawe.xml.elements.Activity)userObject). 86 getOwnerProcess(); 87 baEditor=new BlockActivityEditor(parentWindow,wp,this,pEditor); 88 89 baEditor.getGraph().createWorkflowGraph(parentWindow); 90 } 91 92 public WorkflowManager getWorkflowManager () { 93 try { 94 return baEditor.getGraph().getWorkflowManager(); 95 } 96 catch (Exception ex) { 97 return null; 98 } 99 } 100 101 public AbstractEditor getParentEditor () { 102 return pEditor; 103 } 104 105 } 106 | Popular Tags |