Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre - CEA2016-10-03 11:12:55 -0400
committerGerrit Code Review @ Eclipse.org2016-10-05 04:09:15 -0400
commit36a73668e86a37ccd50f8f49c8e7ad089b23d28d (patch)
treed6b33f4f992106f07112a5019bb04dad97574d35 /plugins
parent3801439697317e258827568b901763949d248d35 (diff)
downloadorg.eclipse.papyrus-36a73668e86a37ccd50f8f49c8e7ad089b23d28d.tar.gz
org.eclipse.papyrus-36a73668e86a37ccd50f8f49c8e7ad089b23d28d.tar.xz
org.eclipse.papyrus-36a73668e86a37ccd50f8f49c8e7ad089b23d28d.zip
Bug 502861 - [SysML 1.1][test] failure on extra
- adding a test to detect if the dnd manipulates only a link or at least one node Change-Id: I89456fd94d7430a1ac5eeef96eb8e9334cab2984 Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java14
-rw-r--r--plugins/sysml/pom.xml2
2 files changed, 13 insertions, 3 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java
index 6eb9309e52f..16c87238cdf 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java
@@ -164,7 +164,15 @@ public abstract class CommonDiagramDragDropEditPolicy extends DiagramDragDropEdi
RefreshConnectionsRequest refreshRequest = new RefreshConnectionsRequest(newValues);
Command refreshCommand = getHost().getCommand(refreshRequest);
- // Prepare an arrange command to avoid every dropped view to appear at the same location
+ // Prepare an arrange command to avoid every dropped view to appear at the same location only if newValues contains at least one node, not when you just drag a link
+ boolean isOneNode = false;
+ for(Object o : newValues){
+ if(o instanceof Node){
+ isOneNode=true;
+ break;
+ }
+ }
+
ArrangeRequest arrangeRequest = new ArrangeRequest(RequestConstants.REQ_ARRANGE_DEFERRED);
arrangeRequest.setViewAdaptersToArrange(newValues);
Command arrangeCommand = getHost().getCommand(arrangeRequest);
@@ -172,7 +180,9 @@ public abstract class CommonDiagramDragDropEditPolicy extends DiagramDragDropEdi
// Update the complete drop command (drop - refresh - arrange)
Command dropCommand = new ICommandProxy(gmfDropCommand);
completeDropCommand.add(dropCommand.chain(refreshCommand));
- completeDropCommand.add(arrangeCommand);
+ if(isOneNode){
+ completeDropCommand.add(arrangeCommand);
+ }
// add snap command if required
// 430099: [Diagram] Snap to Grid for elements dropped from the ModelExplorer is ignored
diff --git a/plugins/sysml/pom.xml b/plugins/sysml/pom.xml
index 508dca59906..ce7f8931f8a 100644
--- a/plugins/sysml/pom.xml
+++ b/plugins/sysml/pom.xml
@@ -11,7 +11,7 @@
<relativePath>../../releng/extra</relativePath>
</parent>
<name>Papyrus SysML</name>
- <description>Top container of the Papyrus SysML 1.1 modeler.</description>
+ <description>Top container of the Papyrus SysML 1.1 modeler</description>
<modules>
<module>diagram</module>

Back to the top