svn commit: r15078 - trunk/src/argouml-app/src/org/argouml/uml/diagram: ui use_case/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2008-06-24 13:24:30-0700
New Revision: 15078

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java

Log:
Fix for issue 5160: Use case fig height grows when typing name

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=15078&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=15077&r2=15078
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2008-06-24 13:24:30-0700
@@ -2291,16 +2291,19 @@
      * @param fg the FigGroup to change the font of.
      */
     private void deepUpdateFont(FigGroup fg) {
+        boolean changed = false;
         List<Fig> figs = fg.getFigs();
         for (Fig f : figs) {
             if (f instanceof ArgoFigText) {
                 ((ArgoFigText) f).diagramFontChanged(null);
-                fg.calcBounds();
+                changed = true;
             }
             if (f instanceof FigGroup) {
                 deepUpdateFont((FigGroup) f);
-                f.calcBounds();
             }
         }
+        if (changed) {
+            fg.calcBounds();
+        }
     }
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java?view=diff&rev=15078&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java&r1=15077&r2=15078
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java	2008-06-24 13:24:30-0700
@@ -1277,6 +1277,31 @@
         }
     }
     
+    /*
+     * @see org.tigris.gef.presentation.Fig#calcBounds()
+     */
+    public void calcBounds() {
+        // the stereotype fig must not have an impact,
+        // so it is temporary moved out of the way
+        int y = 0;
+        if (((FigGroup) getStereotypeFig()).getFigCount() > 0) {
+            y = getStereotypeFig().getY();
+            getStereotypeFig().setBounds(
+                    getStereotypeFig().getX(),
+                    getY(),
+                    getStereotypeFig().getWidth(),
+                    getStereotypeFig().getHeight());
+        }
+        super.calcBounds();
+        // now move it back
+        if (((FigGroup) getStereotypeFig()).getFigCount() > 0) {
+            getStereotypeFig().setBounds(
+                    getStereotypeFig().getX(),
+                    y,
+                    getStereotypeFig().getWidth(),
+                    getStereotypeFig().getHeight());
+        }
+    }
 
     /**
      * Get a list of the extension point Figs <em>without</em> the first fig
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.