svn commit: r13855 - trunk/src_new/org/argouml/ui/StylePanelFig.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-12-06 01:11:52-0800
New Revision: 13855

Modified:
   trunk/src_new/org/argouml/ui/StylePanelFig.java

Log:
Add TODOs for exception and magic numbers

Modified: trunk/src_new/org/argouml/ui/StylePanelFig.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/StylePanelFig.java?view=diff&rev=13855&p1=trunk/src_new/org/argouml/ui/StylePanelFig.java&p2=trunk/src_new/org/argouml/ui/StylePanelFig.java&r1=13854&r2=13855
==============================================================================
--- trunk/src_new/org/argouml/ui/StylePanelFig.java	(original)
+++ trunk/src_new/org/argouml/ui/StylePanelFig.java	2007-12-06 01:11:52-0800
@@ -222,7 +222,9 @@
         } else {
             hasEditableBoundingBox(true);
         }
-        if (target == null) return;
+        if (target == null) {
+            return;
+        }
 
         // The boundary box as held in the target fig, and as listed in
         // the
@@ -306,7 +308,9 @@
     protected void setTargetBBox() {
     	Fig target = getPanelTarget();
         // Can't do anything if we don't have a fig.
-        if (target == null) { return; }
+        if (target == null) {
+            return;
+        }
         // Parse the boundary box text. Null is
         // returned if it is empty or
         // invalid, which causes no change. Otherwise we tell
@@ -314,7 +318,9 @@
         // a change, make the change and tell GEF we've
         // finished.
         Rectangle bounds = parseBBox();
-        if (bounds == null) { return; }
+        if (bounds == null) {
+            return;
+        }
 
         if (!target.getBounds().equals(bounds)) {
             target.setBounds(bounds.x, bounds.y, bounds.width,
@@ -370,6 +376,8 @@
                 return res;
             }
             res.width = Integer.parseInt(st.nextToken());
+            // TODO: What does the magic number 6000 represent here?
+            // Put it in an explanatory literal! - tfm - 20071205
             if ((res.width + res.x) > 6000) {
                 res.width = 6000 - res.x;
                 changed = true;
@@ -379,11 +387,16 @@
                 return res;
             }
             res.height = Integer.parseInt(st.nextToken());
+            // TODO: What does the magic number 6000 represent here?
+            // Put it in an explanatory literal! - tfm - 20071205
             if ((res.height + res.y) > 6000) {
                 res.height = 6000 - res.y;
                 changed = true;
             }
             if (res.x < 0 || res.y < 0 || res.width < 0 || res.height < 0) {
+                // TODO: This exception will be thrown during autoscrolling
+                // when the edge of the canvas is reached causing either
+                // the width or height to be "adjusted" to a negative value
                 throw new IllegalArgumentException();
             }
             if (changed) {
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.