Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2017-05-30 18:48:08 +0000
committerPatrick Tessier2017-05-30 20:17:20 +0000
commite8074b0614af98092ecb35bc28177317fa8d12bd (patch)
tree8b54bc9e67f82a2989b57c36d6a8defb54452a16 /plugins
parent68a5e5b2d9495336ae1617ad5345b2b431bf6b7d (diff)
downloadorg.eclipse.papyrus-e8074b0614af98092ecb35bc28177317fa8d12bd.tar.gz
org.eclipse.papyrus-e8074b0614af98092ecb35bc28177317fa8d12bd.tar.xz
org.eclipse.papyrus-e8074b0614af98092ecb35bc28177317fa8d12bd.zip
Bug 517400 - [SequenceDiagram] problem about order of message after
moving a lifeline Change-Id: I8286c9ca87c79e4059ba911d92ac71866ba31287
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ConnectInteractionOperandToGridEditPolicy.java22
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java14
3 files changed, 43 insertions, 13 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ConnectInteractionOperandToGridEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ConnectInteractionOperandToGridEditPolicy.java
index 637a8b30c67..9e39809e0f0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ConnectInteractionOperandToGridEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/ConnectInteractionOperandToGridEditPolicy.java
@@ -118,5 +118,25 @@ public class ConnectInteractionOperandToGridEditPolicy extends ConnectRectangle
}
}
}
-
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.ConnectRectangleToGridEditPolicy#updateHeightFromAxisNotification(org.eclipse.draw2d.geometry.PrecisionRectangle, org.eclipse.gmf.runtime.notation.Bounds)
+ *
+ * @param originPosition
+ * @param currentBounds
+ */
+ @Override
+ protected void updateHeightFromAxisNotification(PrecisionRectangle originPosition, Bounds currentBounds) {
+ // do nothing the grid cannot update the position of interactionOperand
+
+ }
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling.ConnectRectangleToGridEditPolicy#updateYFromAxisNotification(org.eclipse.draw2d.geometry.PrecisionRectangle, org.eclipse.gmf.runtime.notation.Bounds)
+ *
+ * @param originPosition
+ * @param currentBounds
+ */
+ @Override
+ protected void updateYFromAxisNotification(PrecisionRectangle originPosition, Bounds currentBounds) {
+ // do nothing the grid cannot update the position of interactionOperand
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java
index 9cdb96e6b67..fedc5dee786 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/GridManagementEditPolicy.java
@@ -373,9 +373,13 @@ public class GridManagementEditPolicy extends GraphicalEditPolicyEx implements A
if ((((EObject) notification.getNotifier()).eContainer()) instanceof DecorationNode && rows.contains((((EObject) notification.getNotifier()).eContainer()))) {
if (notification.getFeature().equals(NotationPackage.eINSTANCE.getLocation_Y())) {
DecorationNode movedRow=(DecorationNode)(((EObject) notification.getNotifier()).eContainer());
- // when we move line we disconnect listeners to avoid problems of infinite loop
+ //when the row is connected to interaction operand --> do nothing
+ if(movedRow.getElement() instanceof InteractionOperand) {
+ return;
+ }
if (moveAllLinesAtSamePosition) {
ArrayList<DecorationNode> rowlist = getRowAtPosition(notification.getOldIntValue());
+ // when we move line we disconnect listeners to avoid problems of infinite loop
((EObject) getHost().getModel()).eResource().eAdapters().remove(contentDiagramListener);
// maybe we must move other lines
@@ -387,11 +391,9 @@ public class GridManagementEditPolicy extends GraphicalEditPolicyEx implements A
}
for (Iterator<DecorationNode> iterator = rowlist.iterator(); iterator.hasNext();) {
DecorationNode axis = (DecorationNode) iterator.next();
- if((movedRow.getElement() instanceof Lifeline)&& (axis.getElement() instanceof Lifeline)) {
-
- execute(new SetBoundsCommand(getDiagramEditPart(getHost()).getEditingDomain(), "update Line", new EObjectAdapter(axis), new Point(0, notification.getNewIntValue())));
- }
- else if(!(movedRow.getElement() instanceof Lifeline)) {
+
+ //we do not move line about Lifeline and interaction operand
+ if(!(axis.getElement() instanceof Lifeline)&&(!(axis.getElement() instanceof InteractionOperand))) {
execute(new SetBoundsCommand(getDiagramEditPart(getHost()).getEditingDomain(), "update Line", new EObjectAdapter(axis), new Point(0, notification.getNewIntValue())));
}
@@ -497,8 +499,12 @@ public class GridManagementEditPolicy extends GraphicalEditPolicyEx implements A
if(!(rowsCopy.get(i).equals(movedRow))) {
LayoutConstraint aConstraint = rowsCopy.get(i).getLayoutConstraint();
if (aConstraint instanceof Location) {
+ //do not move row connected to interaction operand
+ if((!(rowsCopy.get(i).getElement() instanceof InteractionOperand))) {
+
execute(new SetCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), aConstraint, NotationPackage.eINSTANCE.getLocation_Y(), ((Location) aConstraint).getY() + margin));
- }
+ }
+ }
}
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java
index 0ea2a5fe816..c1f083adadb 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java
@@ -109,24 +109,28 @@ public class OccurrenceSpecificationHelperAdvice extends AbstractEditHelperAdvic
Message m=(Message)currentEObject;
if( os.equals(m.getSendEvent())) {
dependentsToDestroy.add(m);
- dependentsToDestroy.add(m.getReceiveEvent());
+ if(m.getReceiveEvent()!=null) {
+ dependentsToDestroy.add(m.getReceiveEvent());
+ }
}
if( os.equals(m.getReceiveEvent())) {
dependentsToDestroy.add(m);
- dependentsToDestroy.add(m.getSendEvent());
+ if(m.getSendEvent()!=null) {
+ dependentsToDestroy.add(m.getSendEvent());
+ }
}
}
if( currentEObject instanceof ExecutionSpecification) {
ExecutionSpecification exec=(ExecutionSpecification)currentEObject;
if( os.equals(exec.getStart())) {
dependentsToDestroy.add(exec);
- if( !(exec.getFinish() instanceof MessageEnd)) {
+ if( exec.getFinish()!= null&&!(exec.getFinish() instanceof MessageEnd)) {
dependentsToDestroy.add(exec.getFinish());
}
}
- if( os.equals(exec.getStart())) {
+ if( os.equals(exec.getFinish())) {
dependentsToDestroy.add(exec);
- if( !(exec.getStart() instanceof MessageEnd)) {
+ if( exec.getStart()!= null&& !(exec.getStart() instanceof MessageEnd)) {
dependentsToDestroy.add(exec.getStart());
}
}

Back to the top