svn commit: r13992 - trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2007-12-23 18:19:21-0800
New Revision: 13992

Modified:
   trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java

Log:
If there are no stereotypes, we return 0,0 as the minimum size of the fig (see issue 4939)

Modified: trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java?view=diff&rev=13992&p1=trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&r1=13991&r2=13992
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	(original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	2007-12-23 18:19:21-0800
@@ -24,6 +24,7 @@
 
 package org.argouml.uml.diagram.ui;
 
+import java.awt.Dimension;
 import java.awt.Image;
 import java.beans.PropertyChangeEvent;
 import java.util.ArrayList;
@@ -371,4 +372,23 @@
         this.hidingStereotypesWithIcon = hidingStereotypesWithIcon;
         updateHiddenStereotypes();
     }
+    
+    @Override
+    public Dimension getMinimumSize() {
+        // if there are no stereotypes, we return (0,0), preventing 
+        // double lines in the class (see issue 4939)
+        Dimension dim = null;
+        Object modelElement = getOwner();
+        
+        if (modelElement != null) {
+            Collection stereos = Model.getFacade().getStereotypes(modelElement);
+            if (stereos.size() > 0) {
+                dim = super.getMinimumSize();
+            }
+        }
+        if (dim == null) {
+            dim = new Dimension(0, 0);
+        }
+        return dim;
+    }
 }
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.