svn commit: r16578 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesGroup.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-01-11 16:33:06-0800
New Revision: 16578

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

Log:
Don't query the model for number of stereotypes when we have that information locally anyway. This resolves defect 5580 is the model can change underneath the diagram view it is safer to use data we have in the view.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesGroup.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesGroup.java?view=diff&pathrev=16578&r1=16577&r2=16578
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesGroup.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesGroup.java	2009-01-11 16:33:06-0800
@@ -251,6 +251,22 @@
         return null;
     }
     
+    /**
+     * Get all the child figs that represent the individual stereotypes
+     * @return a List of the stereotype Figs
+     */
+    private List<FigStereotype> getStereotypeFigs() {
+        final List<FigStereotype> stereotypeFigs =
+            new ArrayList<FigStereotype>();
+        for (Object f : getFigs()) {
+            if (f instanceof FigStereotype) {
+                FigStereotype fs = (FigStereotype) f;
+                stereotypeFigs.add(fs);
+            }
+        }
+        return stereotypeFigs;
+    }
+    
     private FigKeyword findFigKeyword() {
         for (Object f : getFigs()) {
             if (f instanceof FigKeyword) {
@@ -431,7 +447,7 @@
         Object modelElement = getOwner();
         
         if (modelElement != null) {
-            Collection stereos = Model.getFacade().getStereotypes(modelElement);
+            List<FigStereotype> stereos = getStereotypeFigs();
             if (stereos.size() > 0 || keyword != null) {
                 int minWidth = 0;
                 int minHeight = 0;

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

To unsubscribe from this discussion, e-mail: [[email protected]].
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.