Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2018-01-11 14:59:53 +0000
committerLaurent Redor2018-01-11 15:07:20 +0000
commit28af4597e801a15047fdebf559e2a2e0bbc2b604 (patch)
treec8b74938de5acea81ed86c1693e89b13ab462aac
parentdea2bf7dabcb6ac0480691993bc950557db7fe45 (diff)
downloadorg.eclipse.sirius-28af4597e801a15047fdebf559e2a2e0bbc2b604.tar.gz
org.eclipse.sirius-28af4597e801a15047fdebf559e2a2e0bbc2b604.tar.xz
org.eclipse.sirius-28af4597e801a15047fdebf559e2a2e0bbc2b604.zip
[529536] Do not select container for selection from right to left
Fix the problem detected by Jessy, comment 4 on bugzilla 529536 [1]. [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=529536#c3 Bug: 529536 Change-Id: I2ec8a318da800c8ff8329a69d7d4bc2f43ef1def Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html2
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile2
-rw-r--r--plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java5
3 files changed, 5 insertions, 4 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html
index 1932386555..a041d5d653 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html
+++ b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html
@@ -1145,7 +1145,7 @@
</p>
<ul>
<li>Selection from left to right: all the elements completely contained in the rectangle will get selected</li>
- <li>Selection from right to left: all the elements that intersect the rectangle will get selected</li>
+ <li>Selection from right to left: all the elements that intersect the rectangle will get selected (except the container under the initial mouse location)</li>
</ul>
<p>To allow selection by drawing a rectangle on a container, you must simultaneously press the ALT key (otherwise the container is drag&#8217;n&#8217;dropped).</p>
<p>Selected elements have an outline and anchors drawn on their border. Note that when a selection contains multiple elements, exactly one of them has black selection anchors; the rest have white anchors. The element with the black anchors is called the primary selection, and some tools treat it differently than the others (for example alignment tools).</p>
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile
index d22736f5a4..bcb641077c 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile
@@ -779,7 +779,7 @@ A few general tools are available in standard on all Sirius diagrams. They appea
__Selection__. The _selection_ tool is the default one initially selected when you open a diagram. To select an element on a diagram while this tool is active, simply click on it. To select several elements at the same time, you can either draw a rectangle on the diagram, or click on each element individually while keeping the _Ctrl_ key pressed. When selecting elements which are already selected using this method, by clicking on them or drawing a rectangle around them, they are removed from the selection. You can combine both methods (de/selection by single click or by zone) to build complex selection incrementally by always keeping the _Ctrl_ key pressed.
The selection of several elements by drawing a rectangle has 2 modes:
* Selection from left to right: all the elements completely contained in the rectangle will get selected
-* Selection from right to left: all the elements that intersect the rectangle will get selected
+* Selection from right to left: all the elements that intersect the rectangle will get selected (except the container under the initial mouse location)
To allow selection by drawing a rectangle on a container, you must simultaneously press the ALT key (otherwise the container is drag'n'dropped).
Selected elements have an outline and anchors drawn on their border. Note that when a selection contains multiple elements, exactly one of them has black selection anchors; the rest have white anchors. The element with the black anchors is called the primary selection, and some tools treat it differently than the others (for example alignment tools).
diff --git a/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java
index fda0964ce4..eced098e4f 100644
--- a/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java
+++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java
@@ -1,5 +1,5 @@
/******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -165,7 +165,7 @@ public class RubberbandSelectionTool extends AbstractTool {
getMarqueeFeedbackFigure().translateToRelative(r);
if ((selectionMode == SELECTION_CONTAINED_MODE && marqueeBounds.contains(r.getTopLeft()) && marqueeBounds.contains(r.getBottomRight()))
|| (selectionMode == SELECTION_TOUCHED_MODE && ((child instanceof ConnectionEditPart && pl.intersects(marqueeBounds)) || (!(child instanceof ConnectionEditPart) && marqueeBounds
- .intersects(r))))) {
+ .intersects(r) && !r.contains(marqueeBounds.getBottomRight()))))) {
newSelections.add(child);
}
}
@@ -598,6 +598,7 @@ public class RubberbandSelectionTool extends AbstractTool {
if (schedulePaint) {
Display.getCurrent().timerExec(DELAY, new Runnable() {
+ @Override
public void run() {
offset++;
if (offset > 5) {

Back to the top