1 10 11 package org.enhydra.jawe.graph; 12 13 import org.enhydra.jawe.xml.*; 14 import org.enhydra.jawe.xml.elements.*; 15 16 import org.jgraph.graph.*; 17 18 import java.util.*; 19 import java.awt.*; 20 import javax.swing.*; 21 import org.enhydra.jawe.*; 22 23 27 public class Process extends Activity { 28 29 protected transient PackageEditor packageEditor; 30 31 35 protected transient ProcessEditor pEditor=null; 36 37 40 public Process(PackageEditor pkgEd) { 41 this(null,pkgEd); 42 } 43 44 47 public Process(Object userObject,PackageEditor pkgEd) { 48 super(userObject); 49 packageEditor=pkgEd; 50 } 51 52 public ProcessEditor getImplementationEditor () { 53 return pEditor; 54 } 55 56 public PackageEditor getPackageEditor () { 57 return packageEditor; 58 } 59 60 public XMLElement getProcessProperties () { 61 return pEditor.getGraph().getPropertyObject(); 62 } 63 64 67 public void showProcess (Window parentWindow) { 68 WorkflowProcess wp=(WorkflowProcess)userObject; 69 if (pEditor == null) { 70 pEditor=new ProcessEditor(parentWindow,(WorkflowProcess)userObject,packageEditor); 71 pEditor.getStatusBar().updateMessage(); 72 pEditor.showWindow(parentWindow,pEditor.getTitle()); 73 } else { 74 pEditor.getStatusBar().updateMessage(); 75 pEditor.showWindow(parentWindow,pEditor.getTitle()); 76 } 77 } 78 79 public void createWorkflowGraph (Window parentW) { 80 pEditor=new ProcessEditor(parentW,(WorkflowProcess)userObject,packageEditor); 81 pEditor.getGraph().createWorkflowGraph(parentW); 82 } 83 84 88 public void showPropertyDialog(Window parentWindow,AbstractGraph graph){ 89 XMLElementDialog d; 90 if (parentWindow instanceof JFrame) { 91 d=new XMLElementDialog((JFrame)parentWindow, 92 ResourceManager.getLanguageDependentString("DialogProcessProperties")+ 93 " - "+userObject.toString()); 94 } else { 95 d=new XMLElementDialog((JDialog)parentWindow, 96 ResourceManager.getLanguageDependentString("DialogProcessProperties")+ 97 " - "+userObject.toString()); 98 } 99 d.editXMLElement(getPropertyObject().getPanel(),true,false); 100 } 101 102 105 public String getTooltip () { 106 try { 107 return ((WorkflowProcess)userObject).getTooltip(); 108 } catch (Exception e) { 109 return null; 110 } 111 } 112 113 } 114 | Popular Tags |