From 2cc6e2633e76a7d1376e20aa7db2ba0262432606 Mon Sep 17 00:00:00 2001 From: dragonmacher <48328597+dragonmacher@users.noreply.github.com> Date: Mon, 23 Nov 2020 20:41:08 -0500 Subject: [PATCH] GP-430 - Graph - fixed broken 'drag to select nodes' --- .../mouse/JungPickingGraphMousePlugin.java | 24 +++++++++++-------- .../VisualGraphPickingGraphMousePlugin.java | 3 --- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/JungPickingGraphMousePlugin.java b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/JungPickingGraphMousePlugin.java index 7b0b165b0c..aa7887d232 100644 --- a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/JungPickingGraphMousePlugin.java +++ b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/JungPickingGraphMousePlugin.java @@ -257,16 +257,7 @@ public class JungPickingGraphMousePlugin extends AbstractGraphMousePlugin @SuppressWarnings("unchecked") public void mouseReleased(MouseEvent e) { VisualizationViewer vv = (VisualizationViewer) e.getSource(); - if (e.getModifiersEx() == modifiers) { - if (down != null) { - Point2D out = e.getPoint(); - - if (vertex == null && heyThatsTooClose(down, out, 5) == false) { - pickContainedVertices(vv, down, out, true); - } - } - } - else if (e.getModifiersEx() == this.addToSelectionModifiers) { + if (e.getModifiersEx() == this.addToSelectionModifiers) { if (down != null) { Point2D out = e.getPoint(); @@ -275,6 +266,19 @@ public class JungPickingGraphMousePlugin extends AbstractGraphMousePlugin } } } + else { + + // Mouse released without the 'add to selection' modifiers. See if we have been dragging + if (down != null) { + // check to see if we were dragging (no vertex picked and a large enough rectangle) + Point2D out = e.getPoint(); + if (vertex == null && heyThatsTooClose(down, out, 5) == false) { + pickContainedVertices(vv, down, out, true); + } + } + + } + down = null; vertex = null; edge = null; diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/VisualGraphPickingGraphMousePlugin.java b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/VisualGraphPickingGraphMousePlugin.java index d1a71e2348..d05fcb040b 100644 --- a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/VisualGraphPickingGraphMousePlugin.java +++ b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/VisualGraphPickingGraphMousePlugin.java @@ -151,9 +151,6 @@ public class VisualGraphPickingGraphMousePlugin