svn commit: r16857 - trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigLifeLine.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-03-06 03:35:07-0800
New Revision: 16857

Modified:
   trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigLifeLine.java

Log:
Issue 5628: Destroy occurs on incoming message rather than outgoing

Modified: trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigLifeLine.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigLifeLine.java?view=diff&pathrev=16857&r1=16856&r2=16857
==============================================================================
--- trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigLifeLine.java	(original)
+++ trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigLifeLine.java	2009-03-06 03:35:07-0800
@@ -164,16 +164,28 @@
                                     figMessage);
                             activationsCount++;
                         }
-                    } else if (figMessage.isCallAction()
+                    } else {
+                        if (figMessage.isCallAction()
                                 && isSameClassifierRoles(
                                         currentActivation.getActivatingMessage(),
                                         figMessage)) {
-                        activationsCount++;
+                            activationsCount++;
+                        } else if (figMessage.isDestroyAction()) {
+                            // if we are the target of a destroy action
+                            // the figlifeline ends here and we add the activation
+                            ySender = figMessage.getFinalY();
+                            currentActivation.setHeight(
+                                    ySender - currentActivation.getY());
+                            currentActivation.setDestroy(true);
+                            lineFig.setHeight(ySender - getY());
+                            newActivations.add(currentActivation);
+                            currentActivation = null;
+                        }
                     }
                 }
                 
-                if (isOutgoing(figMessage) && currentActivation != null) {
-                    if (currentActivation.isActivatorEnd(figMessage)
+                if (isOutgoing(figMessage) && currentActivation != null
+                    && currentActivation.isActivatorEnd(figMessage)
                             && --activationsCount == 0) {
                         // if we are the source of a return action
                         // the activation ends here.
@@ -182,17 +194,6 @@
                                 ySender - currentActivation.getY());
                         newActivations.add(currentActivation);
                         currentActivation = null;
-                    } else if (figMessage.isDestroyAction()) {
-                        // if we are the target of a destroy action
-                        // the figlifeline ends here and we add the activation
-                        ySender = figMessage.getFinalY();
-                        currentActivation.setHeight(
-                                ySender - currentActivation.getY());
-                        currentActivation.setDestroy(true);
-                        lineFig.setHeight(ySender - getY());
-                        newActivations.add(currentActivation);
-                        currentActivation = null;
-                    }
                 }
             }
         }

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

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.