Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-09-28 07:42:40 -0400
committerPatrick Tessier2019-01-18 09:10:06 -0500
commitc5b1c370f77fefbbae50542760ebe039bb9b8d35 (patch)
treecfdb2baf7db5d07736ed369b5f89f3e12661ff19
parent0a9410397d1f9bb1961f80d77087b3e814806e40 (diff)
downloadorg.eclipse.papyrus-c5b1c370f77fefbbae50542760ebe039bb9b8d35.tar.gz
org.eclipse.papyrus-c5b1c370f77fefbbae50542760ebe039bb9b8d35.tar.xz
org.eclipse.papyrus-c5b1c370f77fefbbae50542760ebe039bb9b8d35.zip
Bug 539241: [sequence diagram] problem fragments ordering
https://bugs.eclipse.org/bugs/show_bug.cgi?id=539241 Change-Id: I6fc0e068d8be0cc4a3207493c9356850789f83cf Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ComputeOwnerHelper.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ComputeOwnerHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ComputeOwnerHelper.java
index ef18971911b..c6a890f844a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ComputeOwnerHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ComputeOwnerHelper.java
@@ -137,6 +137,14 @@ public class ComputeOwnerHelper implements IComputeOwnerHelper {
}
}
}
+ } else {
+ if (!(aFragment instanceof InteractionOperand)) {
+ elementForInteraction.add(aFragment);
+ if (aFragment instanceof ExecutionOccurrenceSpecification) {
+ Optional<ExecutionSpecification> exec = getStartedExecution((OccurrenceSpecification) aFragment);
+ exec.ifPresent(elementForInteraction::add);
+ }
+ }
}
@@ -223,12 +231,26 @@ public class ComputeOwnerHelper implements IComputeOwnerHelper {
});
}
}
+ } else if (row.getElement() instanceof InteractionOperand) {
+ // Sort the fragment owning the operand (The position of the CF is the position of its first operand)
+ InteractionOperand operand = (InteractionOperand) row.getElement();
+ CombinedFragment fragment = getOwningFragment(operand);
+ if (fragment != null && fragments.contains(fragment) && !sortedList.contains(fragment)) {
+ sortedList.add(fragment);
+ }
}
-
}
+
return sortedList;
}
+ private CombinedFragment getOwningFragment(InteractionOperand operand) {
+ if (operand.getOwner() instanceof CombinedFragment) {
+ return (CombinedFragment) operand.getOwner();
+ }
+ return null;
+ }
+
/**
* simplify the list of interaction operand to find only one.
* all interaction operand in this list must have a relation owner-owned.
@@ -238,7 +260,7 @@ public class ComputeOwnerHelper implements IComputeOwnerHelper {
protected static void simplifyOwnerInteractionOperand(ArrayList<InteractionOperand> operandList) {
/*
* while (operandList.size() > 1) {
- *
+ *
* InteractionOperand last = operandList.get(operandList.size() - 1);
* EObject parent = last.eContainer();
* while (parent != null) {

Back to the top