cashew-s-editor-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[CASHeW-s-editor-patches] AllTheProbsInTheParserHaveBeenSolved


From: Xianfeng Liu
Subject: [CASHeW-s-editor-patches] AllTheProbsInTheParserHaveBeenSolved
Date: Mon, 11 Apr 2005 01:09:31 +0100

Hi, I think I have solved all the problems in the codes right now. The parser 
works fine. Previously, it could not draw the connection correctly, and if you 
add a new node in a reopened file, you can not add any connections between the 
old one and the new one. Now, it works fine!

Roger <address@hidden>

Index: resource/plugin.xml
===================================================================
RCS file: plugin.xml
diff -N plugin.xml
--- /tmp/cvsAAAjGaigy Mon Apr 11 01:05:09 2005
+++ /dev/null Mon Apr 11 00:00:03 2005
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin id="nongnu.cashews.eclipse.composer"
-   name="CASheW-s"
-   version="0.0.0"
-   provider-name="The CASheW-s Project"
-   class="nongnu.cashews.eclipse.composer.Plugin">
-
-   <runtime>
-      <library name="composer.jar"/>
-   </runtime>
-   <requires>
-      <import plugin="org.eclipse.core.runtime"/>
-      <import plugin="org.eclipse.gef"/>
-      <import plugin="org.eclipse.core.resources"/>
-      <import plugin="org.eclipse.ui.views"/>
-      <import plugin="org.eclipse.jface"/>
-      <import plugin="org.eclipse.ui"/>
-      <import plugin="org.eclipse.ui.workbench"/>
-      <import plugin="org.eclipse.ui.cheatsheets"/>
-      <import plugin="org.eclipse.ui.console"/>
-      <import plugin="org.eclipse.ui.editors"/>
-      <import plugin="org.eclipse.ui.externaltools"/>
-      <import plugin="org.eclipse.ui.forms"/>
-      <import plugin="org.eclipse.ui.ide"/>
-      <import plugin="org.eclipse.ui.intro"/>
-   </requires>
-
-   <extension point="org.eclipse.ui.editors">
-      <editor id="nongnu.cashews.eclipse.composer.editor"
-            name="Cashews Editor"
-            default="true"
-            icon=""
-            extensions="composer"
-            
contributorClass="nongnu.cashews.eclipse.composer.actions.DiagramActionBarContributor"
-            class="nongnu.cashews.eclipse.composer.ui.DiagramEditor">
-      </editor>
-   </extension>
-
-   <extension point="org.eclipse.ui.newWizards">
-      <category id="nongnu.cashews.eclipse.composer" name="Composer"/>
-      <wizard id="nongnu.cashews.eclipse.composer.wizard.new.file"
-            name="Composer Model"
-            category="nongnu.cashews.eclipse.composer"
-            class="nongnu.cashews.eclipse.composer.ui.DiagramCreationWizard">
-         <description>Wizard for creating a new CASheW-s process 
diagram.</description>
-         <selection class="org.eclipse.core.resources.IResource">
-         </selection>
-      </wizard>
-   </extension>
-
-</plugin>
\ No newline at end of file
Index: src/nongnu/cashews/eclipse/composer/model/DiagramParser.java
===================================================================
RCS file: 
/share/darwin/darwin4/cvs/java/src/nongnu/cashews/eclipse/composer/model/DiagramParser.java,v
retrieving revision 1.10
diff -u -r1.10 DiagramParser.java
--- src/nongnu/cashews/eclipse/composer/model/DiagramParser.java 2005/04/10 
22:50:02 1.10
+++ src/nongnu/cashews/eclipse/composer/model/DiagramParser.java 2005/04/11 
00:05:08
@@ -59,6 +59,8 @@
 
   private List<String> sourceList;
 
+  boolean duplicateAtTheEnd = false;
+
   private List<String> targetList;
 
   public DiagramParser()
@@ -94,6 +96,11 @@
       {
         targetNodeName = (String) targetNames.next();
         sourceNodeName = (String) sourceNames.next();
+        if (diagramNodeCount >= diagramNodes.size())
+          {
+            diagramNodeCount--;
+            duplicateAtTheEnd = true;
+          }
         Node sourceNode = (Node) diagramNodes.get(diagramNodeCount);
         if (sourceNode.getName().equals(sourceNodeName))
           {
@@ -105,8 +112,18 @@
                 targetNode = (Node) j.next();
                 if (targetNode.getName().equals(targetNodeName))
                   {
-                    sourceNode.outputs = new ArrayList<Connection>();
-                    new Connection(sourceNode, targetNode);
+                    if (duplicateAtTheEnd == true)
+                      {
+
+                        sourceNode.outputs.add(new Connection(sourceNode,
+                                                              targetNode));
+                      }
+                    else
+                      {
+                        sourceNode.outputs = new ArrayList<Connection>();
+                        new Connection(sourceNode, targetNode);
+                      }
+
                   }
               }
             diagramNodeCount++;
Index: plugin.xml
===================================================================
RCS file: plugin.xml
diff -N plugin.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ plugin.xml 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin id="nongnu.cashews.eclipse.composer"
+   name="CASheW-s"
+   version="0.0.0"
+   provider-name="The CASheW-s Project"
+   class="nongnu.cashews.eclipse.composer.Plugin">
+
+   <runtime>
+      <library name="composer.jar"/>
+   </runtime>
+   <requires>
+      <import plugin="org.eclipse.core.runtime"/>
+      <import plugin="org.eclipse.gef"/>
+      <import plugin="org.eclipse.core.resources"/>
+      <import plugin="org.eclipse.ui.views"/>
+      <import plugin="org.eclipse.jface"/>
+      <import plugin="org.eclipse.ui"/>
+      <import plugin="org.eclipse.ui.workbench"/>
+      <import plugin="org.eclipse.ui.cheatsheets"/>
+      <import plugin="org.eclipse.ui.console"/>
+      <import plugin="org.eclipse.ui.editors"/>
+      <import plugin="org.eclipse.ui.externaltools"/>
+      <import plugin="org.eclipse.ui.forms"/>
+      <import plugin="org.eclipse.ui.ide"/>
+      <import plugin="org.eclipse.ui.intro"/>
+   </requires>
+
+   <extension point="org.eclipse.ui.editors">
+      <editor id="nongnu.cashews.eclipse.composer.editor"
+            name="Cashews Editor"
+            default="true"
+            icon=""
+            extensions="composer"
+            
contributorClass="nongnu.cashews.eclipse.composer.actions.DiagramActionBarContributor"
+            class="nongnu.cashews.eclipse.composer.ui.DiagramEditor">
+      </editor>
+   </extension>
+
+   <extension point="org.eclipse.ui.newWizards">
+      <category id="nongnu.cashews.eclipse.composer" name="Composer"/>
+      <wizard id="nongnu.cashews.eclipse.composer.wizard.new.file"
+            name="Composer Model"
+            category="nongnu.cashews.eclipse.composer"
+            class="nongnu.cashews.eclipse.composer.ui.DiagramCreationWizard">
+         <description>Wizard for creating a new CASheW-s process 
diagram.</description>
+         <selection class="org.eclipse.core.resources.IResource">
+         </selection>
+      </wizard>
+   </extension>
+
+</plugin>

Attachment: AllTheProbsInTheParserHaveBeenSolved.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]