svn commit: r16763 - trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java

Michiel van der Wulp <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2009-02-03 23:17:10-0800
New Revision: 16763

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

Log:
Fix for issue 5685: Dragging a composite state does not take along its enclosed states.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java?view=diff&pathrev=16763&r1=16762&r2=16763
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java	2009-02-03 23:17:10-0800
@@ -242,14 +242,29 @@
     @Override
     public Vector<Fig> getEnclosedFigs() {
         Vector<Fig> enclosedFigs = super.getEnclosedFigs();
-        
-        TreeMap<Integer, Fig> figsByY = new TreeMap<Integer, Fig>();
-        for (Fig fig : enclosedFigs) {
-            if (fig instanceof FigConcurrentRegion) {
-                figsByY.put(fig.getY(), fig);
+
+        if (isConcurrent()) {
+            TreeMap<Integer, Fig> figsByY = new TreeMap<Integer, Fig>();
+            for (Fig fig : enclosedFigs) {
+                if (fig instanceof FigConcurrentRegion) {
+                    figsByY.put(fig.getY(), fig);
+                }
             }
+            return new Vector<Fig>(figsByY.values());
+        }
+        return enclosedFigs;
+    }
+    
+    /**
+     * @return true if this is a concurrent state, 
+     * false otherwise, or if the owner is not known
+     */
+    public boolean isConcurrent() {
+        Object owner = getOwner();
+        if (owner == null) {
+            return false;
         }
-        return new Vector<Fig>(figsByY.values());
+        return Model.getFacade().isConcurrent(owner);
     }
 
     /**

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

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.