svn commit: r17326 - trunk/src/argouml-app/src/org/argouml: persistence uml/diagram/ui

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-09-15 04:12:25-0700
New Revision: 17326

Modified:
   trunk/src/argouml-app/src/org/argouml/persistence/PGML.tee
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java

Log:
Save the UUIDs of the association ends in the PGML for a FigAssociation so that we can later reload them and guarantee association ends in the correct sequence.

Modified: trunk/src/argouml-app/src/org/argouml/persistence/PGML.tee
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/persistence/PGML.tee?view=diff&pathrev=17326&r1=17325&r2=17326
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/persistence/PGML.tee	(original)
+++ trunk/src/argouml-app/src/org/argouml/persistence/PGML.tee	2009-09-15 04:12:25-0700
@@ -536,35 +536,22 @@
 <![CDATA[
 
 <group name="<ocl>org.argouml.persistence.PgmlUtility.getId(self)</ocl>"
-
      description="<ocl>self.class.name</ocl>"
-
      href="<ocl ignoreNull>org.argouml.uml.UUIDHelper.getUUID(self)</ocl>"
-
+     sourceConnector="<ocl ignoreNull>org.argouml.uml.UUIDHelper.getUUID(self.sourceConnector)</ocl>"
+     destConnector="<ocl ignoreNull>org.argouml.uml.UUIDHelper.getUUID(self.destinationConnector)</ocl>"
      stroke="<ocl>self.lineWidth</ocl>"
-
      strokecolor="<ocl>self.lineColor</ocl>"
-
 >
-
   <private>
-
     ItemUID="<ocl ignoreNull>self.ItemUID</ocl>"
     sourcePortFig="<ocl>org.argouml.persistence.PgmlUtility.getId(self.sourcePortFig)</ocl>"
-
     destPortFig="<ocl>org.argouml.persistence.PgmlUtility.getId(self.destPortFig)</ocl>"
-
     sourceFigNode="<ocl>org.argouml.persistence.PgmlUtility.getId(self.sourceFigNode)</ocl>"
-
     destFigNode="<ocl>org.argouml.persistence.PgmlUtility.getId(self.destFigNode)</ocl>"
-    
     <ocl>self.pathItemStrategies</ocl>
   </private>
-
-
-
   <ocl>self.fig</ocl>
-
 </group>
 
 ]]>

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java?view=diff&pathrev=17326&r1=17325&r2=17326
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java	2009-09-15 04:12:25-0700
@@ -273,6 +273,42 @@
         return Model.getFacade().getClassifier(destEnd.getOwner());
     }
     
+    /**
+     * Get the model element at the source end of the edge. This is not the
+     * same as the owner of the node at the source end, rather it is the
+     * element that connects the element of the edge to the element of the
+     * node.
+     * Mostly this returns null as the edge connects directly to the node but
+     * implementations such as the Fig for association will return an
+     * association end that connects the association to the classifier.
+     * @return the model element that connects the edge to the node (or null
+     * if the edge requires no such connector.
+     */
+    public Object getSourceConnector() {
+        if (srcEnd == null) {
+            return null;
+        }
+        return srcEnd.getOwner();
+    }
+    
+    /**
+     * Get the model element at the destination end of the edge. This is not
+     * the same as the owner of the node at the source end, rather it is the
+     * element that connects the element of the edge to the element of the
+     * node.
+     * Mostly this returns null as the edge connects directly to the node but
+     * implementations such as the Fig for association will return an
+     * association end that connects the association to the classifier.
+     * @return the model element that connects the edge to the node (or null
+     * if the edge requires no such connector.
+     */
+    public Object getDestinationConnector() {
+        if (destEnd == null) {
+            return null;
+        }
+        return destEnd.getOwner();
+    }
+    
     
 
     /*

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java?view=diff&pathrev=17326&r1=17325&r2=17326
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	2009-09-15 04:12:25-0700
@@ -1309,6 +1309,37 @@
         }
         return null;
     }
+    
+    /**
+     * Get the model element at the source end of the edge. This is not the
+     * same as the owner of the node at the source end, rather it is the
+     * element that connects the element of the edge to the element of the
+     * node.
+     * Mostly this returns null as the edge connects directly to the node but
+     * implementations such as the Fig for association will return an
+     * association end that connects the association to the classifier.
+     * @return the model element that connects the edge to the node (or null
+     * if the edge requires no such connector.
+     */
+    public Object getSourceConnector() {
+        return null;
+    }
+    
+    /**
+     * Get the model element at the destination end of the edge. This is not
+     * the same as the owner of the node at the source end, rather it is the
+     * element that connects the element of the edge to the element of the
+     * node.
+     * Mostly this returns null as the edge connects directly to the node but
+     * implementations such as the Fig for association will return an
+     * association end that connects the association to the classifier.
+     * @return the model element that connects the edge to the node (or null
+     * if the edge requires no such connector.
+     */
+    public Object getDestinationConnector() {
+        return null;
+    }
+    
     /**
      * Returns the destination of the edge. The destination is the
      * owner of the node the edge travels to in a binary

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2394976

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.