diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java index 164cb9de86e..cb9f741681a 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CustomGeneralOrderingEditPart.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2010 CEA + * Copyright (c) 2010, 2018 CEA List, EclipseSource and others * * * All rights reserved. This program and the accompanying materials @@ -11,16 +11,13 @@ * * Contributors: * Soyatec - Initial API and implementation + * EclipseSource - Bug 537561 * *****************************************************************************/ package org.eclipse.papyrus.uml.diagram.sequence.edit.parts; import org.eclipse.draw2d.Connection; import org.eclipse.emf.common.notify.Notification; -import org.eclipse.gef.ConnectionEditPart; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.requests.ReconnectRequest; import org.eclipse.gmf.runtime.notation.NotationPackage; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart; @@ -65,51 +62,7 @@ public class CustomGeneralOrderingEditPart extends GeneralOrderingEditPart imple @Override protected void setLineWidth(int width) { - getPrimaryShape().setLineWidth(width < 0 ? 1 : 0); - } - - @Override - public EditPart getTargetEditPart(Request request) { - EditPart ep = super.getTargetEditPart(request); - if (ep != null && ep instanceof org.eclipse.gef.ConnectionEditPart) { - if (request instanceof ReconnectRequest) { - ReconnectRequest rRequest = (ReconnectRequest) request; - - // If source anchor is moved, the connection's source edit part - // should not be taken into account for a cyclic dependency - // check so as to avoid false checks. Same goes for the target - // anchor. See bugzilla# 417373 -- we do not want to target a - // connection that is already connected to us so that we do not - // introduce a cyclic connection - if (isCyclicConnectionRequest((org.eclipse.gef.ConnectionEditPart) ep, rRequest.getConnectionEditPart())) { - return null; - } - } - } - - return ep; - } - - /** - * Fixed bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=417373 - * - * The ends of GeneralOrderingEditPart are MessageEndEditParts which parent are Message*EditParts, once we move the ends of the messages, we - * should IGNORE to move current GeneralOrdering, otherwise cyclic dependency occur. - * - */ - private boolean isCyclicConnectionRequest(ConnectionEditPart currentConn, ConnectionEditPart reqConn) { - if (currentConn == null || reqConn == null) { - return false; - } - EditPart source = currentConn.getSource(); - EditPart target = currentConn.getTarget(); - if (reqConn == source || reqConn == target) { - return true; - } - if (reqConn == source.getParent() || reqConn == target.getParent()) { - return true; - } - return false; + getPrimaryShape().setLineWidth(width < 0 ? 1 : width); } } |