Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2018-09-13 09:49:58 -0400
committerPatrick Tessier2018-09-14 08:44:47 -0400
commit0a67f5ec7e414ed66d21cd52d9ab748c13649b1b (patch)
tree1a8c8211e64256f2a5ce0d460d219262ae0a8d18
parent6ef395417a548f3060d0874a463b52be5cf9b7a7 (diff)
downloadorg.eclipse.papyrus-0a67f5ec7e414ed66d21cd52d9ab748c13649b1b.tar.gz
org.eclipse.papyrus-0a67f5ec7e414ed66d21cd52d9ab748c13649b1b.tar.xz
org.eclipse.papyrus-0a67f5ec7e414ed66d21cd52d9ab748c13649b1b.zip
Bug 539026: [Sequence Diagram] Delete a message declared on same
lifeline does not remove the graphical element When checking the references, we need to if the other referenced element is not the same like the current one before work on it. Change-Id: Ie4da8257ee92de6dd41a983d76c9821629e8ea48 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java
index 64efbaf2783..20d57307d1b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java
@@ -196,7 +196,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
// for each weak reference move it
for (Iterator<EditPart> iterator = weakReferences.iterator(); iterator.hasNext();) {
EditPart editPart = iterator.next();
- if (!SenderRequestUtils.isASender(request, editPart)) {// avoid loop
+ if (!hostConnectionEditPart.equals(editPart) && !SenderRequestUtils.isASender(request, editPart)) {// avoid loop
UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG, "+--> try to Move " + editPart);//$NON-NLS-1$
ArrayList<EditPart> senderList = SenderRequestUtils.getSenders(request);
if (editPart instanceof ConnectionEditPart) {
@@ -242,7 +242,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
// Get the life lines
final EditPart source = messageEditPart.getSource();
final EditPart target = messageEditPart.getTarget();
- final Collection<EditPart> editParts = new HashSet<EditPart>(2);
+ final Collection<EditPart> editParts = new HashSet<>(2);
editParts.add(source);
editParts.add(target);
@@ -446,7 +446,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
/**
* This allows to updates life lines height if necessary.
- *
+ *
* @param request
* The initial request.
* @param hostConnectionEditPart
@@ -468,7 +468,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
if (!SenderRequestUtils.isASender(request, getHost())) {
// Gets weak references
- final List<EditPart> weakAndStrongReferences = new ArrayList<EditPart>();
+ final List<EditPart> weakAndStrongReferences = new ArrayList<>();
weakAndStrongReferences.addAll(references.getWeakReferences().keySet());
weakAndStrongReferences.addAll(references.getStrongReferences().keySet());
@@ -478,7 +478,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
final Point initialSourcePosition = polyline.getSourceAnchor().getReferencePoint();
final Point initialTargetPosition = polyline.getTargetAnchor().getReferencePoint();
- final Set<LifelineEditPart> lifelineEditParts = new HashSet<LifelineEditPart>();
+ final Set<LifelineEditPart> lifelineEditParts = new HashSet<>();
if (hostConnectionEditPart.getSource() instanceof LifelineEditPart) {
lifelineEditParts.add((LifelineEditPart) hostConnectionEditPart.getSource());
}
@@ -681,7 +681,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
/**
* This allows to get the command for bounds of life lines corresponding to the initial request when only one message create is modifying life lines.
- *
+ *
* @param request
* The initial request.
* @param hostConnectionEditPart
@@ -709,7 +709,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
newDimension.height = LIFELINE_MIN_HEIGHT;
final int maxY = newLocation.y + newDimension.height;
- final Collection<LifelineEditPart> lifeLineEditPartsToSkip = new HashSet<LifelineEditPart>(1);
+ final Collection<LifelineEditPart> lifeLineEditPartsToSkip = new HashSet<>(1);
lifeLineEditPartsToSkip.add(targetLifeLine);
LifelineEditPartUtil.resizeAllLifeLines(compoundCommand, hostConnectionEditPart, maxY, lifeLineEditPartsToSkip);
}
@@ -726,7 +726,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
/**
* This allows to get the command for bounds of life lines corresponding to the initial request when only one message delete is modifying life lines.
- *
+ *
* @param request
* The initial request.
* @param hostConnectionEditPart
@@ -751,7 +751,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
final int maxY = bounds.getY() + newDimension.height();
// We need to check if this is needed to resize other life lines
- final Collection<LifelineEditPart> lifeLineEditPartsToSkip = new HashSet<LifelineEditPart>(1);
+ final Collection<LifelineEditPart> lifeLineEditPartsToSkip = new HashSet<>(1);
lifeLineEditPartsToSkip.add(targetLifeLine);
LifelineEditPartUtil.resizeAllLifeLines(compoundCommand, hostConnectionEditPart, maxY, lifeLineEditPartsToSkip);
}
@@ -875,7 +875,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
@SuppressWarnings("unchecked")
protected void showMoveLineSegFeedback(BendpointRequest request) {
RouterKind kind = RouterKind.getKind(getConnection(), getConnection().getPoints());
- if (((getHost() instanceof MessageSyncEditPart || getHost() instanceof MessageAsyncEditPart || getHost() instanceof MessageDeleteEditPart) && kind == RouterKind.SELF) || kind == RouterKind.OBLIQUE){
+ if (((getHost() instanceof MessageSyncEditPart || getHost() instanceof MessageAsyncEditPart || getHost() instanceof MessageDeleteEditPart) && kind == RouterKind.SELF) || kind == RouterKind.OBLIQUE) {
if (router == null) {
router = getConnection().getConnectionRouter();
getConnection().setConnectionRouter(new DummyRouter());

Back to the top