right click rectangle selection

This commit is contained in:
bancika
2017-05-10 15:25:43 +02:00
parent a8665271b0
commit d1a7227f4c
4 changed files with 33 additions and 8 deletions
@@ -2,6 +2,8 @@ package org.diylc.swing.plugins.canvas;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import org.diylc.common.IPlugInPort;
@@ -21,7 +23,13 @@ class CanvasGestureListener implements DragGestureListener {
@Override
public void dragGestureRecognized(DragGestureEvent dge) {
presenter.dragStarted(dge.getDragOrigin(), dge.getDragAction());
boolean forceReSelection = false;
InputEvent e = dge.getTriggerEvent();
if (e instanceof MouseEvent) {
MouseEvent me = (MouseEvent) e;
forceReSelection = me.getButton() != MouseEvent.BUTTON1;
}
presenter.dragStarted(dge.getDragOrigin(), dge.getDragAction(), forceReSelection);
dge.startDrag(presenter.getCursorAt(dge.getDragOrigin()), new EmptyTransferable(), new CanvasSourceListener(
presenter));
}
+18 -2
View File
@@ -1764,7 +1764,7 @@
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Ability to force components to the front or back of other components even outisde their designated layers, allowing placing components or jumpers below boards, etc.</description>
<description>Ability to force components to the front or back of other components even outisde their designated layers, allowing placing components or jumpers below boards, etc</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
@@ -1772,7 +1772,7 @@
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Duplicate selection option in Edit menu and popup menu (Ctrl+D).</description>
<description>Duplicate selection option in Edit menu and popup menu (Ctrl+D)</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
@@ -1808,6 +1808,22 @@
</org.diylc.appframework.update.Change>
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version>
<org.diylc.appframework.update.Version>
<versionNumber>
<major>3</major>
<minor>41</minor>
<build>0</build>
</versionNumber>
<releaseDate>2017-05-08 00:00:00.000 CET</releaseDate>
<name></name>
<changes>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Using right click to draw a selection rectangle doesn't move objects under the cursor (useful for selecting multiple components that have a big board below)</description>
</org.diylc.appframework.update.Change>
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version>
</a>
</java.util.Arrays_-ArrayList>