svn commit: r13837 - trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramNode.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-11-24 13:23:59-0800
New Revision: 13837

Modified:
   trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramNode.java

Log:
Inline getSubtreeWeight call so all information is in one place

Modified: trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramNode.java?view=diff&rev=13837&p1=trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramNode.java&p2=trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramNode.java&r1=13836&r2=13837
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramNode.java	(original)
+++ trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramNode.java	2007-11-24 13:23:59-0800
@@ -167,7 +167,7 @@
 
     /**
      * Calculate the weight of this node. The function distinguishes between
-     * note-nodes and standard-nodes, because a note shall be positioned to the
+     * note-nodes and standard-nodes, because a note should be positioned to the
      * right of its first related node, if it exists. Therefor the weight is a
      * function of the weight of the related node. For standard-nodes the weight
      * is a function of up-/downlinks, column and uplink factor.
@@ -176,14 +176,14 @@
      */
     public float calculateWeight() {
         weight = 0;
-        float w = getSubtreeWeight();
         for (ClassdiagramNode node : uplinks) {
             weight = Math.max(weight, node.getWeight()
                     * UPLINK_FACTOR
                     * (1 + 1 / Math
                             .max(1, node.getColumn() + UPLINK_FACTOR)));
         }
-        weight += w + 1 / Math.max(1, getColumn() + UPLINK_FACTOR);
+        weight += getSubtreeWeight()
+                + (1 / Math.max(1, getColumn() + UPLINK_FACTOR));
         return weight;
     }
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.