Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre - CEA2015-01-15 09:36:35 -0500
committerFrancois Le Fevre - CEA2015-01-20 11:01:43 -0500
commite56d4dbd25ab1ce600cb5d11923d25a8bad207cb (patch)
tree5a6f73a1e4b8012351aeccb004821ed1ac5f8ee0 /plugins
parent5ebd5b7f1593c61b4c4f2a7eda1747eff6dc87e4 (diff)
downloadorg.eclipse.papyrus-e56d4dbd25ab1ce600cb5d11923d25a8bad207cb.tar.gz
org.eclipse.papyrus-e56d4dbd25ab1ce600cb5d11923d25a8bad207cb.tar.xz
org.eclipse.papyrus-e56d4dbd25ab1ce600cb5d11923d25a8bad207cb.zip
Bug 445892
[Sequence Diagram] NPE when Double Clicking on Links tool function adapted in order to work only for two selected node elements and not in the case of an edge element. Change-Id: Icbfdd8aecae37126326468541a3c48b7f54be0d3 Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java6
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
index 782e0f00a21..3085d107af4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
@@ -30,6 +30,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.draw2d.ui.figures.IOvalAnchorableFigure;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.papyrus.extensionpoints.editors.Activator;
import org.eclipse.papyrus.uml.diagram.common.util.Util;
@@ -237,7 +238,7 @@ public class LayoutUtils {
* an Affixed Child Node
*
* @param sourceEditPart
- * he source EditPart
+ * the source EditPart
* @param targetEditPart
* the targetEditPart
* @return <ul>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
index a183c9ef425..d38e70a2e75 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
@@ -58,6 +58,7 @@ import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.preferences.ConnectionToolPreferences;
import org.eclipse.papyrus.uml.diagram.common.layout.LayoutUtils;
import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
@@ -180,6 +181,11 @@ public class AspectUnspecifiedTypeConnectionTool extends UnspecifiedTypeConnecti
break;
}
}
+
+ // do nothing if you have at least one edge element
+ if( !(sourceEditPart instanceof NodeEditPart) || !(targetEditPart instanceof NodeEditPart)){
+ break;
+ }
CreateConnectionRequest connectionRequest = createTargetRequest();
// get the anchors locations

Back to the top