svn commit: r16561 - branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml: persistence uml/diagram/ui

Dave Thompson <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: dthompson
Date: 2009-01-10 11:44:49-0800
New Revision: 16561

Modified:
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/persistence/PGML.tee
   branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java

Log:
Tweaked PGML output to save things slightly differently, with better attribute names.
Added methods for setting displacement vector angle with a double, as well as int (overload).
Corrected a mistake (had misinterpreted meaning of pathOffset, and was using getPathOffset(), when should have been using getVectorOffset()).

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/persistence/PGML.tee
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/persistence/PGML.tee?view=diff&pathrev=16561&r1=16560&r2=16561
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/persistence/PGML.tee	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/persistence/PGML.tee	2009-01-10 11:44:49-0800
@@ -141,10 +141,9 @@
 
 <![CDATA[
 
-<argouml:pathitem name="<ocl>org.argouml.persistence.PgmlUtility.getId(self.pathFig)</ocl>"
-                  description="<ocl>self.class.name</ocl>"
-                  href="<ocl ignoreNull>org.argouml.uml.UUIDHelper.getUUID(self.pathFig)</ocl>"
-                  pathFig="<ocl>self.pathFig.toString</ocl>" />
+<argouml:pathitem figname="<ocl>org.argouml.persistence.PgmlUtility.getId(self.pathFig)</ocl>"
+                  classname="<ocl>self.class.name</ocl>"
+                  ownerhref="<ocl ignoreNull>org.argouml.uml.UUIDHelper.getUUID(self.pathFig)</ocl>" />
 
 ]]>
 
@@ -158,12 +157,12 @@
 <![CDATA[
 
 <argouml:pathitem figname="<ocl>org.argouml.persistence.PgmlUtility.getId(self.itemFig)</ocl>"
-                  description="<ocl>self.class.name</ocl>"
-                  figdescription="<ocl>self.itemFig.class.name</ocl>"
-                  href="<ocl ignoreNull>org.argouml.uml.UUIDHelper.getUUID(self.itemFig)</ocl>"
+                  classname="<ocl>self.class.name</ocl>"
+                  figclassname="<ocl>self.itemFig.class.name</ocl>"
+                  ownerhref="<ocl ignoreNull>org.argouml.uml.UUIDHelper.getUUID(self.itemFig)</ocl>"
                   percent="<ocl>self.percent</ocl>"
                   angle="<ocl>self.angle</ocl>"
-                  offset="<ocl>self.pathOffset</ocl>" />
+                  offset="<ocl>self.vectorOffset</ocl>" />
 
 ]]>
 

Modified: branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java?view=diff&pathrev=16561&r1=16560&r2=16561
==============================================================================
--- branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java	(original)
+++ branches/work_issue1048_dthompson/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java	2009-01-10 11:44:49-0800
@@ -446,6 +446,19 @@
     }
     
     /**
+     * Set the displacement vector to the given angle and distance.
+     * 
+     * @param vectorAngle angle in degrees relative to the edge at the anchor
+     *            point.
+     * @param vectorDistance distance along vector in drawing coordinate units
+     */
+    public void setDisplacementVector(double vectorAngle, 
+            int vectorDistance) {
+        setDisplacementAngle(vectorAngle);
+        setDisplacementDistance(vectorDistance);
+    }
+    
+    /**
      * @param offsetAngle the new angle for the displacement vector, 
      * specified in degrees relative to the edge at the anchor.
      */
@@ -455,6 +468,15 @@
     }
 
     /**
+     * @param offsetAngle the new angle for the displacement vector, 
+     * specified in degrees relative to the edge at the anchor.
+     */
+    public void setDisplacementAngle(double offsetAngle) {
+        angle = offsetAngle * Math.PI / 180.0;
+        useAngle = true;
+    }
+
+    /**
      * Set distance along displacement vector to place the figure.
      * @param newDistance distance in units of the drawing coordinate system
      */
@@ -698,24 +720,24 @@
     }
     
     /**
-     * Returns the value of the angle field.
+     * Returns the value of the angle field converted to degrees.
      * The angle of the path item relative to the edge.
      * @important Used by PGML.tee.
-     * @return The value of the angle field.
+     * @return The value of the angle field in degrees.
      */
     public double getAngle() {
-        return angle;
+        return angle * 180 / Math.PI;
     }
     
     /**
-     * Returns the value of the pathOffset field.
-     * The pathOffset field is the distance away from the edge, along the 
+     * Returns the value of the vectorOffset field.
+     * The vectorOffset field is the distance away from the edge, along the 
      * path vector that the item Fig is placed.
      * @important Used by PGML.tee.
-     * @return The value of the pathOffset field.
+     * @return The value of the vectorOffset field.
      */
-    public int getPathOffset() {
-        return pathOffset;
+    public int getVectorOffset() {
+        return vectorOffset;
     }
     /** End of methods used by PGML.tee */

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

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.