/[cashew-s-editor]/cashews/src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java
ViewVC logotype

Diff of /cashews/src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by gnu_andrew, Thu Mar 31 17:35:21 2005 UTC revision 1.2 by gnu_andrew, Thu May 5 23:47:58 2005 UTC
# Line 37  to any source code in the Content. Line 37  to any source code in the Content.
37    
38  package nongnu.cashews.eclipse.composer.commands;  package nongnu.cashews.eclipse.composer.commands;
39    
40    import java.util.Iterator;
41    import java.util.Vector;
42    
43  import nongnu.cashews.eclipse.composer.model.Diagram;  import nongnu.cashews.eclipse.composer.model.Diagram;
44  import nongnu.cashews.eclipse.composer.model.Node;  import nongnu.cashews.eclipse.composer.model.Node;
45  import nongnu.cashews.eclipse.composer.model.RectangleNode;  import nongnu.cashews.eclipse.composer.wizards.ProcessData;
46    import nongnu.cashews.eclipse.composer.wizards.ProcessDefine;
47    
48  import org.eclipse.draw2d.geometry.Point;  import org.eclipse.draw2d.geometry.Point;
49  import org.eclipse.gef.commands.Command;  import org.eclipse.gef.commands.Command;
50    import org.eclipse.jface.window.ApplicationWindow;
51    import org.eclipse.jface.wizard.WizardDialog;
52    import org.eclipse.ui.dialogs.FileSelectionDialog;
53    import org.eclipse.ui.dialogs.FileSystemElement;
54    
55  public class CreateNodeCommand  public class CreateNodeCommand
56    extends Command    extends Command
# Line 53  public class CreateNodeCommand Line 61  public class CreateNodeCommand
61    private Node node;    private Node node;
62    
63    private Point location;    private Point location;
64      
65      public String pName,oName;
66      
67      public Vector names;
68    
69      //ProcessData data = new ProcessData();
70    public CreateNodeCommand()    public CreateNodeCommand()
71    {    {
     node = new RectangleNode("Fred");  
72    }    }
73    
74    // setters    // setters
# Line 64  public class CreateNodeCommand Line 76  public class CreateNodeCommand
76    public void setDiagram(Diagram diagram)    public void setDiagram(Diagram diagram)
77    {    {
78      this.diagram = diagram;      this.diagram = diagram;
79        DiagramSingleton ds = DiagramSingleton.getInstance();
80        ds.setDiagram(diagram);
81    }    }
82    
83    public void setNode(Node node)    public void setNode(Node node)
# Line 75  public class CreateNodeCommand Line 89  public class CreateNodeCommand
89    {    {
90      this.location = location;      this.location = location;
91    }    }
92      
93      public void setName(String name){
94       this.pName = name;
95       System.out.println("ccc" + pName);
96      }
97    // ------------------------------------------------------------------------    // ------------------------------------------------------------------------
98    // Overridden from Command    // Overridden from Command
99    
# Line 85  public class CreateNodeCommand Line 103  public class CreateNodeCommand
103    }    }
104    
105    public void execute()    public void execute()
106    {    
107      {   ProcessDefine pd = new ProcessDefine(null);
108        pd.run();
109        pName = pd.getPerformanceName();
110        oName = pd.getOperationName();
111      //System.out.println("data" + data);
112        if (pd.status.equals("OK")){
113            
114      if (location != null)      if (location != null)
115        {        {
116            System.out.println(pName);
117            if (pName != null){
118            node.setName(pName + ":" + oName);}
119          node.setLocation(location);          node.setLocation(location);
120        }        }
121      diagram.addNode(node);      diagram.addNode(node);    }
122        else{
123          return;      
124        }
125    }    }
126    
127    public void undo()    public void undo()

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26