Author: bobtarling
Date: 2011-04-26 13:43:00-0700
New Revision: 19283

Modified:
   
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java
   
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java
   
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java
   
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java

Log:
Don't try and restrict size in setBoundsImpl - this results in multiple call to 
getMinimumSize that can be a performance issue on composite Figs

Modified: 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java?view=diff&pathrev=19283&r1=19282&r2=19283
==============================================================================
--- 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java
        (original)
+++ 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java
        2011-04-26 13:43:00-0700
@@ -31,8 +31,6 @@
     private final DiagramSettings settings;
     private DiagramElement nameDiagramElement;
     
-    private Rectangle bounds;
-    
     /**
      * Constructor a new FigBaseNode
      * 
@@ -43,7 +41,7 @@
     FigBaseNode(final Object owner, final Rectangle bounds,
             final DiagramSettings settings) {
         super(owner);
-        this.bounds = bounds;
+        setBounds(bounds);
         this.settings = settings;
     }
     
@@ -83,7 +81,7 @@
 
         final Rectangle oldBounds = getBounds();
         
-        bounds = new Rectangle(x, y, w, h);
+        Rectangle bounds = new Rectangle(x, y, w, h);
         
         if (oldBounds.equals(bounds)) {
             return;
@@ -97,29 +95,6 @@
         positionChildren();
     }
 
-    protected Rectangle getBoundsImpl() {
-        return bounds;
-    }
-    
-    /**
-     * Change the position of the object from where it is to where it is plus 
dx
-     * and dy. Often called when an object is dragged. This could be very 
useful
-     * if local-coordinate systems are used because deltas need less
-     * transforming... maybe. Fires property "bounds".
-     */
-    protected void translateImpl(int dx, int dy) {
-        if (dx ==0 || dy == 0) {
-            return;
-        }
-        Rectangle oldBounds = getBounds();
-        Rectangle newBounds = new Rectangle(
-                oldBounds.x + dx,
-                oldBounds.y + dy,
-                oldBounds.width,
-                oldBounds.height);
-        setBounds(newBounds);
-    }
-    
     /**
      * This is called to rearrange the contents of the Fig when a childs
      * minimum size means it will no longer fit. If this group also has

Modified: 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java?view=diff&pathrev=19283&r1=19282&r2=19283
==============================================================================
--- 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java
        (original)
+++ 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java
        2011-04-26 13:43:00-0700
@@ -37,7 +37,7 @@
             final Object modelElement,
             final DiagramSettings settings) {
         
-        super(owner, rect, settings);
+        super(owner, settings);
         nameDisplay = new FigNotation(
                 modelElement,
                 new Rectangle(0, 0, 0, 0),

Modified: 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java?view=diff&pathrev=19283&r1=19282&r2=19283
==============================================================================
--- 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java
     (original)
+++ 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java
     2011-04-26 13:43:00-0700
@@ -39,7 +39,7 @@
     public FigCompartment(Object owner, Rectangle bounds,
             DiagramSettings settings, List elements) {
         
-        super(owner, bounds, settings);
+        super(owner, settings);
         
         for (Object element : elements) {
             try {

Modified: 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java?view=diff&pathrev=19283&r1=19282&r2=19283
==============================================================================
--- 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java
       (original)
+++ 
trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java
       2011-04-26 13:43:00-0700
@@ -8,15 +8,11 @@
 
 public class FigComposite extends FigGroup {
     
-    private Rectangle bounds;
-    
     private static final int MARGIN = 0;
     
     public FigComposite(
             final Object owner,
-            final Rectangle bounds,
             final DiagramSettings settings) {
-        this.bounds = bounds;
         setOwner(owner);
     }
     
@@ -54,65 +50,14 @@
             final int w,
             final int h) {
 
-        final int ww;
-        // Refuse to set bounds below the minimum width
-        final int minWidth = getMinimumSize().width;
-        if (w < minWidth) {
-            ww = minWidth;
-        } else {
-            ww = w;
-        }
-        final int hh;
-        final int minHeight = getMinimumSize().height;
-        if (h < minHeight) {
-            hh = minHeight;
-        } else {
-            hh = h;
-        }
-        
-        final Rectangle oldBounds = getBounds();
-        bounds = new Rectangle(x, y, ww, hh);
-        
-        if (oldBounds.equals(bounds)) {
-            return;
-        }
-        
         _x = x;
         _y = y;
-        _w = ww;
-        _h = hh;
+        _w = w;
+        _h = h;
         
         positionChildren();
     }
     
-    protected Rectangle getBoundsImpl() {
-        return bounds;
-    }
-    
-    
-    /**
-     * Change the position of the object from where it is to where it is plus 
dx
-     * and dy. Often called when an object is dragged. This could be very 
useful
-     * if local-coordinate systems are used because deltas need less
-     * transforming... maybe.
-     * @param dx the x delta
-     * @param dy the y delta
-     */
-    @Override
-    protected void translateImpl(int dx, int dy) {
-        if (dx ==0 || dy == 0) {
-            return;
-        }
-        Rectangle oldBounds = getBounds();
-        Rectangle newBounds = new Rectangle(
-                oldBounds.x + dx,
-                oldBounds.y + dy,
-                oldBounds.width,
-                oldBounds.height);
-        setBounds(newBounds);
-    }
-    
-    
     /**
      * This is called to rearrange the contents of the Fig when a childs
      * minimum size means it will no longer fit. If this group also has

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

To unsubscribe from this discussion, e-mail: 
[[email protected]].

Reply via email to