svn commit: r16001 - trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-11-09 03:58:40-0800
New Revision: 16001

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java

Log:
And this fixes sizing problems for stereotypes on the Package Fig when the stereotype is hidden.

Beware that calling getStereotypesFig.isVisible() is not the same as "stereotypeVisible" for a FigPackage.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java?view=diff&rev=16001&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&r1=16000&r2=16001
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java	2008-11-09 03:58:40-0800
@@ -98,7 +98,7 @@
 
     /** The minimal height of the name. */
     private static final int MIN_HEIGHT = 21;
-    /** The minimal height of the name. */
+    /** The minimal width of the name. */
     private static final int MIN_WIDTH = 50;
 
     /** The initial width of the outer box. */
@@ -392,7 +392,7 @@
 
         // If we have any number of stereotypes displayed, then allow 
         // some space for that (width and height):
-        if (getStereotypeFig().isVisible()) {
+        if (stereotypeVisible) {
             Dimension st = getStereotypeFig().getMinimumSize();
             aSize.width =
 		Math.max(aSize.width, st.width);
@@ -459,23 +459,24 @@
 
         int currentY = ya;
 
-        Dimension stereoMin = getStereotypeFig().getMinimumSize();
-        if (getStereotypeFig().isVisible()) {
+        int tabWidth = newW - indentX;
+
+        if (stereotypeVisible) {
+            Dimension stereoMin = getStereotypeFig().getMinimumSize();
             currentY += stereoMin.height;
-        }
+            getStereotypeFig().setBounds(xa, ya,
+                tabWidth, stereoMin.height + 1);
 
-        getStereotypeFig().setBounds(xa, ya,
-                newW - indentX, stereoMin.height + 1);
-        int nameWidth = newW - indentX;
-        if (nameWidth < stereoMin.width + 1) {
-            nameWidth = stereoMin.width + 2;
-        }
-        stereoLineBlinder.setBounds(
+            if (tabWidth < stereoMin.width + 1) {
+                tabWidth = stereoMin.width + 2;
+            }
+            stereoLineBlinder.setBounds(
                 xa + 1,
                 ya + stereoMin.height,
-                nameWidth - 2,
+                tabWidth - 2,
                 2);
-        getNameFig().setBounds(xa, currentY, nameWidth + 1, minNameHeight);
+        }
+        getNameFig().setBounds(xa, currentY, tabWidth + 1, minNameHeight);
 
         // Advance currentY to where the start of the body box is,
         // remembering that it overlaps the next box by 1 pixel. Calculate the
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.