Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Le Menez2019-12-12 10:52:15 +0000
committerPatrick Tessier2020-01-16 09:55:28 +0000
commit2e5f20d250a4a3a7ec4506f3284feb7cdbb85673 (patch)
treefdb9998a51b4afdbbad4d5b5b8273bd2468bc5ec
parent5108f9a3d5ea6467ea0282651a7e92ae57a73d8b (diff)
downloadorg.eclipse.papyrus-2e5f20d250a4a3a7ec4506f3284feb7cdbb85673.tar.gz
org.eclipse.papyrus-2e5f20d250a4a3a7ec4506f3284feb7cdbb85673.tar.xz
org.eclipse.papyrus-2e5f20d250a4a3a7ec4506f3284feb7cdbb85673.zip
Bug 552227 - [Diagram Sequence] Correct selection and creation issue of messageLost/Found
- the receiveEvent could be null but not after the creation of the element. Change-Id: I695092c910e522656eba47fa1cfc5603f2c8b08e Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceForMessageSpecEditPolicy.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java
index aadaee7c9f4..448c5516866 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/SequenceReferenceEditPolicy.java
@@ -264,10 +264,10 @@ public class SequenceReferenceEditPolicy extends GraphicalEditPolicy implements
EditPart editPart = iterator.next();
if (editPart instanceof AbstractMessageEditPart) {
Message message = (Message) (((AbstractMessageEditPart) editPart)).resolveSemanticElement();
- if (message.getSendEvent().equals(event)) {
+ if (null != message.getSendEvent() && message.getSendEvent().equals(event)) {
return true;
}
- if (message.getReceiveEvent().equals(event)) {
+ if (null != message.getReceiveEvent() && message.getReceiveEvent().equals(event)) {
return true;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceForMessageSpecEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceForMessageSpecEditPolicy.java
index 73c501b53b0..d63757199ed 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceForMessageSpecEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceForMessageSpecEditPolicy.java
@@ -46,6 +46,7 @@ import org.eclipse.papyrus.uml.diagram.sequence.util.LogOptions;
import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.uml2.uml.ExecutionSpecification;
import org.eclipse.uml2.uml.Message;
+import org.eclipse.uml2.uml.MessageEnd;
import org.eclipse.uml2.uml.OccurrenceSpecification;
/**
@@ -64,7 +65,7 @@ public class UpdateWeakReferenceForMessageSpecEditPolicy extends UpdateWeakRefer
* @param request
* @return
*
- * <img src="../../../../../../../../../icons/sequenceScheme.png" width="250" />
+ * <img src="../../../../../../../../../icons/sequenceScheme.png" width="250" />
* <UL>
* <LI>when move E --> move B on the coordinate Y of E and move A on the coordinate Y of E
* <LI>when Move F (execution specification) (resize)--> move C on the coordinate of C of F and move D on the coordinate of Y of F
@@ -158,7 +159,8 @@ public class UpdateWeakReferenceForMessageSpecEditPolicy extends UpdateWeakRefer
Point moveDelta = new Point(0, 0);
PolylineConnectionEx polyline = (PolylineConnectionEx) ((ConnectionEditPart) editPart).getFigure();
Point anchorPositionOnScreen;
- if (((Message) element).getSendEvent().equals(nextEvent)) {
+ MessageEnd messageEnd = ((Message) element).getSendEvent();
+ if (null != messageEnd && messageEnd.equals(nextEvent)) {
anchorPositionOnScreen = polyline.getTargetAnchor().getReferencePoint();
} else {
anchorPositionOnScreen = polyline.getSourceAnchor().getReferencePoint();

Back to the top