aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2017-09-19 05:17:58 -0400
committerPatrick Tessier2017-10-06 04:36:30 -0400
commit7b34cbeb964e630f00a02ff0780ce663c3c79a81 (patch)
tree75b06721d29b123a47843be5ba08ca3574412863
parente23cb123bb7655876db76d538f2f12be196d380d (diff)
downloadorg.eclipse.papyrus-7b34cbeb964e630f00a02ff0780ce663c3c79a81.zip
org.eclipse.papyrus-7b34cbeb964e630f00a02ff0780ce663c3c79a81.tar.gz
org.eclipse.papyrus-7b34cbeb964e630f00a02ff0780ce663c3c79a81.tar.xz
Bug 521312 - [Sequence Diagram] Message Lost and Found are not well
managed https://bugs.eclipse.org/bugs/show_bug.cgi?id=521312 bug fix: - Message position is not save after move - Message can't be create anymore other requirement solved with this contribution: - Message can't be reorient upward - Message label don't have icons Change-Id: I853cb145c8c724a163fb9e25d96c430d700a79f9 Signed-off-by: Mickael ADAM <mickael.adam@all4tec.net>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/MessageConnectionLineSegEditPolicy.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceEditPolicy.java5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/LifeLineGraphicalNodeEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src-gen/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java2
9 files changed, 81 insertions, 77 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
index 7a07f57..0ef3b03 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/META-INF/MANIFEST.MF
@@ -70,7 +70,7 @@ Require-Bundle: org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3
org.eclipse.draw2d;visibility:=reexport,
org.eclipse.gmf.runtime.notation;visibility:=reexport
Bundle-Vendor: %providerName
-Bundle-Version: 4.0.0.qualifier
+Bundle-Version: 4.1.0.qualifier
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin
Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.sequence; singleton:=true
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 8c0b4fa..267449b 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
@@ -127,24 +127,26 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
protected Command getMoveMessageCommand(BendpointRequest request) {
if (getHost() instanceof MessageLostEditPart || getHost() instanceof MessageFoundEditPart) {
PointList points = getConnection().getPoints().getCopy();
- CompoundCommand command = new CompoundCommand("Move");
- AbstractMessageEditPart MessageSyncEditPart = (AbstractMessageEditPart) getHost();
+ CompoundCommand command = new CompoundCommand("Move");//$NON-NLS-1$
+ AbstractMessageEditPart messageSyncEditPart = (AbstractMessageEditPart) getHost();
// move source
ReconnectRequest sourceReq = new ReconnectRequest(REQ_RECONNECT_SOURCE);
- sourceReq.setConnectionEditPart(MessageSyncEditPart);
+ sourceReq.setConnectionEditPart(messageSyncEditPart);
Point sourceLocation = points.getFirstPoint().getCopy();
getConnection().translateToAbsolute(sourceLocation);
- EditPart source = MessageSyncEditPart.getSource();
+ sourceLocation = SequenceUtil.getSnappedLocation(getHost(), sourceLocation);
+ EditPart source = messageSyncEditPart.getSource();
sourceReq.setLocation(sourceLocation);
sourceReq.setTargetEditPart(source);
Command moveSourceCommand = source.getCommand(sourceReq);
command.add(moveSourceCommand);
// move target
- EditPart target = MessageSyncEditPart.getTarget();
+ EditPart target = messageSyncEditPart.getTarget();
ReconnectRequest targetReq = new ReconnectRequest(REQ_RECONNECT_TARGET);
- targetReq.setConnectionEditPart(MessageSyncEditPart);
+ targetReq.setConnectionEditPart(messageSyncEditPart);
Point targetLocation = points.getLastPoint().getCopy();
getConnection().translateToAbsolute(targetLocation);
+ targetLocation = SequenceUtil.getSnappedLocation(getHost(), targetLocation);
targetReq.setLocation(targetLocation);
targetReq.setTargetEditPart(target);
Command moveTargetCommand = target.getCommand(targetReq);
@@ -213,7 +215,6 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
compoudCmd.add(tgtCmd);
compoudCmd.add(srcCmd);
compoudCmd.add(new ICommandProxy(moveLifelineCmd));
- compoudCmd.add(new ICommandProxy(setSizeCommand));
} else {
compoudCmd.add(new ICommandProxy(moveLifelineCmd));
compoudCmd.add(new ICommandProxy(setSizeCommand));
@@ -266,7 +267,6 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
}
return compoudCmd;
} else {
- // TODO_MIA to test
int y = request.getLocation().y;
Command srcCmd = createMoveMessageEndCommand((Message) message, srcPart, send, y, srcLifelinePart, request);
Command tgtCmd = createMoveMessageEndCommand((Message) message, tgtPart, rcv, y, targetLifelinePart, request);
@@ -288,6 +288,10 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
return compoudCmd;
}
}
+ } else
+ // Found message case && Lost message case
+ if ((srcLifelinePart == null) && (targetLifelinePart != null) || (srcLifelinePart != null && targetLifelinePart == null)) {
+ return getMoveMessageCommand((BendpointRequest) request);
}
}
}
@@ -308,6 +312,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
ConnectionNodeEditPart connection = (ConnectionNodeEditPart) getHost();
if (isSource) {
ReconnectRequest req = new ReconnectRequest(REQ_RECONNECT_SOURCE);
+ req.getExtendedData().put(SequenceUtil.DO_NOT_CHECK_HORIZONTALITY, true);
req.setConnectionEditPart(connection);
req.setTargetEditPart(endEditPart);
Point location = SequenceUtil.getAbsoluteEdgeExtremity(connection, true);
@@ -317,6 +322,7 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
return command;
} else {
ReconnectRequest req = new ReconnectRequest(REQ_RECONNECT_TARGET);
+ req.getExtendedData().put(SequenceUtil.DO_NOT_CHECK_HORIZONTALITY, true);
req.setConnectionEditPart(connection);
req.setTargetEditPart(endEditPart);
Point location = SequenceUtil.getAbsoluteEdgeExtremity(connection, false);
@@ -349,39 +355,6 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
compoudCmd.add(tgtCmd);
}
return compoudCmd.unwrap();
- // CompoundCommand compoudCmd = new CompoundCommand(Messages.MoveMessageCommand_Label);
- // PointList points = getConnection().getPoints();
- // Point sourceRefPoint = points.getFirstPoint();;
- // Point targetRefPoint = points.getLastPoint();;
- // getConnection().translateToAbsolute(sourceRefPoint);
- // getConnection().translateToAbsolute(targetRefPoint);
- //
- // Point oldSourcePoint = SequenceUtil.findLocationOfEvent(srcLifelinePart, (OccurrenceSpecification)send);
- // int dy = sourceRefPoint.y - oldSourcePoint.y;
- // int dx = request.getLocation().x > sourceRefPoint.x ? 3 : -3;
- //
- // // check bounds
- // NodeFigure fig = srcLifelinePart.getPrimaryShape().getFigureLifelineDotLineFigure().getDashLineRectangle();
- // Rectangle bounds = fig.getBounds().getCopy();
- // fig.translateToAbsolute(bounds);
- //
- // bounds.expand(6, 0);
- // if(!bounds.contains(sourceRefPoint) || !bounds.contains(targetRefPoint)){
- // return UnexecutableCommand.INSTANCE; // cannot move outside lifeline part
- // }
- // sourceRefPoint = sourceRefPoint.translate(dx, 0);
- // targetRefPoint = targetRefPoint.translate(dx, 0);
- // Command srcCmd = getReconnectCommand(connectionPart, srcLifelinePart, sourceRefPoint, RequestConstants.REQ_RECONNECT_SOURCE);
- // Command tgtCmd = getReconnectCommand(connectionPart, srcLifelinePart, targetRefPoint, RequestConstants.REQ_RECONNECT_TARGET);
- //
- // if(dy < 0){ // move up
- // compoudCmd.add(srcCmd);
- // compoudCmd.add(tgtCmd);
- // }else{ // move down
- // compoudCmd.add(tgtCmd);
- // compoudCmd.add(srcCmd);
- // }
- // return compoudCmd;
}
protected Command getReconnectCommand(ConnectionNodeEditPart connectionPart, EditPart targetPart, Point location, String requestType) {
@@ -404,7 +377,9 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
public void showSourceFeedback(Request request) {
if (request instanceof BendpointRequest) {
RouterKind kind = RouterKind.getKind(getConnection(), getConnection().getPoints());
- if (kind == RouterKind.SELF || kind == RouterKind.HORIZONTAL || getConnection() instanceof MessageCreate) {
+ if (getHost() instanceof MessageFoundEditPart || getHost() instanceof MessageLostEditPart) {
+ showMoveLineSegFeedback((BendpointRequest) request);
+ } else if (kind == RouterKind.SELF || kind == RouterKind.HORIZONTAL || getConnection() instanceof MessageCreate) {
if (getLineSegMode() != LineMode.OBLIQUE && REQ_MOVE_BENDPOINT.equals(request.getType())) {
// Fixed bug about show feedback for moving bendpoints, make sure at least 3 points.
List constraint = (List) getConnection().getRoutingConstraint();
@@ -418,10 +393,6 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
showMoveLineSegFeedback((BendpointRequest) request);
}
}
- // Add impossible to move MessageLost and MessageFound by dragging the line.
- else if (getHost() instanceof MessageFoundEditPart || getHost() instanceof MessageLostEditPart) {
- showMoveLineSegFeedback((BendpointRequest) request);
- }
}
}
@@ -492,12 +463,13 @@ public class MessageConnectionLineSegEditPolicy extends ConnectionBendpointEditP
}
PointList linkPoints = getConnection().getPoints().getCopy();
Point ptLoc = new Point(request.getLocation());
+ ptLoc = SequenceUtil.getSnappedLocation(getHost(), ptLoc);
getConnection().translateToRelative(ptLoc);
+
int dy = ptLoc.y - linkPoints.getFirstPoint().y;
int size = linkPoints.size();
for (int i = 0; i < size; i++) {
Point p = linkPoints.getPoint(i).translate(0, dy);
- p.y = SequenceUtil.getSnappedLocation(getHost(), p).y;
linkPoints.setPoint(p, i);
}
if (checkBounds(linkPoints)) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceEditPolicy.java
index 05085b8..4a22e29 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateWeakReferenceEditPolicy.java
@@ -31,6 +31,7 @@ import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
import org.eclipse.papyrus.uml.diagram.sequence.keyboardlistener.IKeyPressState;
import org.eclipse.papyrus.uml.diagram.sequence.keyboardlistener.KeyboardListener;
+import org.eclipse.papyrus.uml.diagram.sequence.util.SequenceUtil;
import org.eclipse.swt.SWT;
import org.eclipse.ui.PlatformUI;
@@ -90,7 +91,7 @@ public abstract class UpdateWeakReferenceEditPolicy extends GraphicalEditPolicy
reconnectRequest.setConnectionEditPart(connectionEditPart);
SenderRequestUtils.addRequestSenders(reconnectRequest, senderList);
SenderRequestUtils.addRequestSender(reconnectRequest, hostEditpart);
- reconnectRequest.setLocation(new Point(100, location.y));
+ reconnectRequest.setLocation(location.getLocation().getCopy());
reconnectRequest.setType(reconnectType);
if (RequestConstants.REQ_RECONNECT_TARGET.equals(reconnectType)) {
reconnectRequest.setTargetEditPart(connectionEditPart.getTarget());
@@ -148,6 +149,7 @@ public abstract class UpdateWeakReferenceEditPolicy extends GraphicalEditPolicy
Point positiononScreen = polyline.getTargetAnchor().getReferencePoint();
newAnchorPositionOnScreen = new Rectangle(positiononScreen.x, positiononScreen.y + moveDelta.y, 0, 0);
ReconnectRequest reconnectTargetRequest = createReconnectRequest(hostEditPart, connectionEditPart, newAnchorPositionOnScreen, senderList, RequestConstants.REQ_RECONNECT_TARGET);
+ reconnectTargetRequest.getExtendedData().put(SequenceUtil.DO_NOT_CHECK_HORIZONTALITY, true);
compoundCommand.add(connectionEditPart.getTarget().getCommand(reconnectTargetRequest));
}
@@ -156,6 +158,7 @@ public abstract class UpdateWeakReferenceEditPolicy extends GraphicalEditPolicy
Point anchorPositionOnScreen = polyline.getSourceAnchor().getReferencePoint();
Rectangle newAnchorPositionOnScreen = new Rectangle(anchorPositionOnScreen.x, anchorPositionOnScreen.y + moveDelta.y, 0, 0);
ReconnectRequest reconnectSourceRequest = createReconnectRequest(hostEditPart, connectionEditPart, newAnchorPositionOnScreen, senderList, RequestConstants.REQ_RECONNECT_SOURCE);
+ reconnectSourceRequest.getExtendedData().put(SequenceUtil.DO_NOT_CHECK_HORIZONTALITY, true);
compoundCommand.add(connectionEditPart.getSource().getCommand(reconnectSourceRequest));
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/LifeLineGraphicalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/LifeLineGraphicalNodeEditPolicy.java
index ef8cae3..47f51e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/LifeLineGraphicalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/referencialgrilling/LifeLineGraphicalNodeEditPolicy.java
@@ -28,6 +28,7 @@ import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gef.commands.UnexecutableCommand;
@@ -38,6 +39,7 @@ import org.eclipse.gef.requests.DropRequest;
import org.eclipse.gef.requests.ReconnectRequest;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
@@ -425,22 +427,23 @@ public class LifeLineGraphicalNodeEditPolicy extends DefaultGraphicalNodeEditPol
* @param request
* The request of Message creation
*/
- protected void forceHorizontalRequest(CreateConnectionViewAndElementRequest request) {
- Map<String, Object> extendedData = request.getExtendedData();
- Object sourceLocation = extendedData.get(RequestParameterConstants.EDGE_SOURCE_POINT);
-
- // only message with a target lower than the source is allowed.
- if (sourceLocation instanceof Point) {
- Point sourceLocationPoint = (Point) sourceLocation;
- Point targetLocation = request.getLocation();
- // Check if the Connection can be considered as Horizontal
- if (sourceLocationPoint.y() != targetLocation.y()) {
- if (request.getConnectionViewAndElementDescriptor().getSemanticHint().equals(UMLDIElementTypes.MESSAGE_CREATE_EDGE.getSemanticHint())
- || isHorizontalConnection(sourceLocationPoint, targetLocation)) {
- Point forceHorizontalPoint = new Point(targetLocation);
- forceHorizontalPoint.setY(sourceLocationPoint.y());
- // Update the request accordingly
- request.setLocation(forceHorizontalPoint);
+ protected void forceHorizontalRequest(Request request) {
+ if (request instanceof CreateConnectionViewAndElementRequest) {
+ Map<String, Object> extendedData = request.getExtendedData();
+ Object sourceLocation = extendedData.get(RequestParameterConstants.EDGE_SOURCE_POINT);
+ // only message with a target lower than the source is allowed.
+ if (sourceLocation instanceof Point) {
+ Point sourceLocationPoint = (Point) sourceLocation;
+ Point targetLocation = ((CreateRequest) request).getLocation();
+ // Check if the Connection can be considered as Horizontal
+ if (sourceLocationPoint.y() != targetLocation.y()) {
+ if (((CreateConnectionViewAndElementRequest) request).getConnectionViewAndElementDescriptor().getSemanticHint().equals(UMLDIElementTypes.MESSAGE_CREATE_EDGE.getSemanticHint())
+ || isHorizontalConnection(sourceLocationPoint, targetLocation)) {
+ Point forceHorizontalPoint = new Point(targetLocation);
+ forceHorizontalPoint.setY(sourceLocationPoint.y());
+ // Update the request accordingly
+ ((CreateRequest) request).setLocation(forceHorizontalPoint);
+ }
}
}
}
@@ -625,12 +628,8 @@ public class LifeLineGraphicalNodeEditPolicy extends DefaultGraphicalNodeEditPol
* @return true if target location point is lower than source location point
*/
private Boolean isTargetLowerThanSource(Point sourceLocation, Point targetLocation) {
- Boolean targetLowerThanSource = true;
// only message with a target lower than the source is allowed.
- Point sourceLocationPoint = (Point) sourceLocation;
- targetLowerThanSource = sourceLocationPoint.y() <= targetLocation.y() + SequenceDiagramConstants.HORIZONTAL_MESSAGE_MAX_Y_DELTA;
- return targetLowerThanSource;
-
+ return sourceLocation.y() <= targetLocation.y();
}
protected GraphicalNodeEditPolicy getBasicGraphicalNodeEditPolicy() {
@@ -648,8 +647,15 @@ public class LifeLineGraphicalNodeEditPolicy extends DefaultGraphicalNodeEditPol
*/
@Override
protected Command getReconnectSourceCommand(final ReconnectRequest request) {
- // Snap to grid the request location
request.setLocation(SequenceUtil.getSnappedLocation(getHost(), request.getLocation()));
+ // Check if the target is lower than the source
+ Point targetLocation = SequenceUtil.getAbsoluteEdgeExtremity((ConnectionNodeEditPart) request.getConnectionEditPart(), false, true);
+ if (!isTargetLowerThanSource(request.getLocation().getCopy(), targetLocation)) {
+ Object object = request.getExtendedData().get(SequenceUtil.DO_NOT_CHECK_HORIZONTALITY);
+ if (!(object instanceof Boolean) || ((object instanceof Boolean) && !((Boolean) object))) {// If not HorizontalMove parameter true
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
return getBasicGraphicalNodeEditPolicy().getCommand(request);
}
@@ -663,6 +669,16 @@ public class LifeLineGraphicalNodeEditPolicy extends DefaultGraphicalNodeEditPol
Command command = null;
// Snap to grid the request location
request.setLocation(SequenceUtil.getSnappedLocation(getHost(), request.getLocation()));
+
+ // Check if the target is lower than the source
+ Point sourceLocation = SequenceUtil.getAbsoluteEdgeExtremity((ConnectionNodeEditPart) request.getConnectionEditPart(), true);
+ if (!isTargetLowerThanSource(sourceLocation, request.getLocation().getCopy())) {
+ Object object = request.getExtendedData().get(SequenceUtil.DO_NOT_CHECK_HORIZONTALITY);
+ if (!(object instanceof Boolean) || ((object instanceof Boolean) && !((Boolean) object))) {// If not HorizontalMove parameter true
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+
Command reconnectTargetCommand = getBasicGraphicalNodeEditPolicy().getCommand(request);
NodeEditPart nodeEP = (NodeEditPart) request.getTarget();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java
index 43009dd..8c2f2cd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/OccurrenceSpecificationMoveHelper.java
@@ -249,6 +249,7 @@ public class OccurrenceSpecificationMoveHelper {
// the message part must start or finish on the lifeline (with the event)
if (part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
Request reconnectRequest = makeReconnectRequest((ConnectionEditPart) part, true, referencePoint, childToReconnectTo);
+ reconnectRequest.getExtendedData().put(SequenceUtil.DO_NOT_CHECK_HORIZONTALITY, true);
ArrayList<EditPart> senderList = SenderRequestUtils.getSenders(request);
SenderRequestUtils.addRequestSenders(reconnectRequest, senderList);
Command reconnect = childToReconnectTo.getCommand(reconnectRequest);
@@ -272,6 +273,7 @@ public class OccurrenceSpecificationMoveHelper {
// the message part must start or finish on the lifeline (with the event)
if (part instanceof ConnectionEditPart && !notToMoveEditParts.contains(part)) {
Request reconnectRequest = makeReconnectRequest((ConnectionEditPart) part, false, referencePoint, childToReconnectTo);
+ reconnectRequest.getExtendedData().put(SequenceUtil.DO_NOT_CHECK_HORIZONTALITY, true);
ArrayList<EditPart> senderList = SenderRequestUtils.getSenders(request);
SenderRequestUtils.addRequestSenders(reconnectRequest, senderList);
Command reconnect = childToReconnectTo.getCommand(reconnectRequest);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java
index b37d9fc..fb3e967 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/SequenceUtil.java
@@ -152,6 +152,11 @@ public class SequenceUtil {
public static final String OBSERVATION_LINK_REQUEST_RECONNECT_TARGET = "observation reconnect target"; //$NON-NLS-1$
/**
+ * Request parameters for not checking the horizontality during reconnect request.
+ */
+ public static final String DO_NOT_CHECK_HORIZONTALITY = "do not check horizontality"; //$NON-NLS-1$
+
+ /**
* Default vertical offset of lifeline
*/
public static final int LIFELINE_VERTICAL_OFFSET = 10;
@@ -445,7 +450,10 @@ public class SequenceUtil {
return getAbsoluteEdgeExtremity(connection, isStart, false);
}
- static Point getAbsoluteEdgeExtremity(ConnectionNodeEditPart connection, boolean isStart, boolean relyOnMessageFigure) {
+ /**
+ * @since 4.1
+ */
+ public static Point getAbsoluteEdgeExtremity(ConnectionNodeEditPart connection, boolean isStart, boolean relyOnMessageFigure) {
Connection msgFigure = connection.getConnectionFigure();
if (connection.getNotationView() instanceof Edge && !relyOnMessageFigure) {
// rather take up to date model information
@@ -511,7 +519,10 @@ public class SequenceUtil {
return findLocationOfMessageOccurrence(nodeEditPart, event, false);
}
- static Point findLocationOfMessageOccurrence(GraphicalEditPart nodeEditPart, MessageOccurrenceSpecification event, boolean relyOnMessageFigure) {
+ /**
+ * @since 4.1
+ */
+ public static Point findLocationOfMessageOccurrence(GraphicalEditPart nodeEditPart, MessageOccurrenceSpecification event, boolean relyOnMessageFigure) {
// messages to the node
List<?> targetConnections = nodeEditPart.getTargetConnections();
for (Object conn : targetConnections) {
@@ -801,6 +812,7 @@ public class SequenceUtil {
* @param nodeEditPart
* the contained edit part or itself
* @return lifeline edit part or null
+ * @since 4.1
*/
public static LifelineEditPart getParentLifelinePart(EditPart nodeEditPart) {
EditPart parent = nodeEditPart;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen
index 71dd551..2399f0a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen
@@ -2045,8 +2045,7 @@
editPartClassName="MessageFoundAppliedStereotypeEditPart"
itemSemanticEditPolicyClassName="MessageFoundAppliedStereotypeItemSemanticEditPolicy"
notationViewFactoryClassName="MessageLabelViewFactory"
- readOnly="true"
- elementIcon="true">
+ readOnly="true">
<diagramRunTimeClass
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<viewmap
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
index 90c6630..9fe9dc4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.diagram.sequence</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src-gen/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src-gen/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
index 4ab665e..ebe9163 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src-gen/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/src-gen/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/MessageFoundAppliedStereotypeEditPart.java
@@ -261,7 +261,7 @@ public class MessageFoundAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected Image getLabelIcon() {
- return DiagramEditPartsUtil.getIcon(getParserElement(), getViewer());
+ return null;
}
/**