From d38a8b5baa757886792e4a3c5cb0b3877b25a256 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 15 Feb 2017 17:12:02 +0000 Subject: [PATCH] =?utf8?q?fix=20for=20JAL-2419=20-=20don=E2=80=99t=20trash=20?= =?utf8?q?the=20current=20selection?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/appletgui/SeqPanel.java | 7 ++++++- src/jalview/gui/SeqPanel.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index 904e3ce..1352fe9 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -1426,7 +1426,12 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (stretchGroup == null || !stretchGroup.contains(sequence, res)) { stretchGroup = av.getAlignment().findGroup(sequence, res); - av.setSelectionGroup(stretchGroup); + if (stretchGroup != null) + { + // only update the current selection if the popup menu has a group to + // focus on + av.setSelectionGroup(stretchGroup); + } } // DETECT RIGHT MOUSE BUTTON IN AWT diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 0046206..55f23aa 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1590,7 +1590,12 @@ public class SeqPanel extends JPanel implements MouseListener, if (stretchGroup == null || !stretchGroup.contains(sequence, res)) { stretchGroup = av.getAlignment().findGroup(sequence, res); - av.setSelectionGroup(stretchGroup); + if (stretchGroup != null) + { + // only update the current selection if the popup menu has a group to + // focus on + av.setSelectionGroup(stretchGroup); + } } if (evt.isPopupTrigger()) // Mac: mousePressed -- 1.7.10.2