From e2745a846737920f1ec43b72d271611784503e4c Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 31 May 2016 10:17:46 +0100 Subject: [PATCH] JAL-1011 JAL-1989 don't mirror column-only selections in unrelated views --- src/jalview/appletgui/SeqPanel.java | 15 ++++++++------- src/jalview/gui/SeqPanel.java | 14 +++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index a4dad4b..31bf6a4 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -1813,9 +1813,12 @@ public class SeqPanel extends Panel implements MouseMotionListener, // do we want to thread this ? (contention with seqsel and colsel locks, I // suspect) - // rules are: colsel is copied if there is a real intersection between - // sequence selection - boolean repaint = false, copycolsel = true; + /* + * only copy colsel if there is a real intersection between + * sequence selection and this panel's alignment + */ + boolean repaint = false; + boolean copycolsel = false; if (av.getSelectionGroup() == null || !av.isSelectionGroupChanged(true)) { SequenceGroup sgroup = null; @@ -1832,11 +1835,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, } sgroup = seqsel.intersect(av.getAlignment(), (av.hasHiddenRows()) ? av.getHiddenRepSequences() : null); - if ((sgroup == null || sgroup.getSize() == 0) - && (colsel == null || colsel.isEmpty())) + if ((sgroup != null && sgroup.getSize() > 0)) { - // don't copy columns if the region didn't intersect. - copycolsel = false; + copycolsel = true; } } if (sgroup != null && sgroup.getSize() > 0) diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index bd4b234..2d44a0f 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1947,10 +1947,12 @@ public class SeqPanel extends JPanel implements MouseListener, // do we want to thread this ? (contention with seqsel and colsel locks, I // suspect) - // rules are: colsel is copied if there is a real intersection between - // sequence selection + /* + * only copy colsel if there is a real intersection between + * sequence selection and this panel's alignment + */ boolean repaint = false; - boolean copycolsel = true; + boolean copycolsel = false; SequenceGroup sgroup = null; if (seqsel != null && seqsel.getSize() > 0) @@ -1964,11 +1966,9 @@ public class SeqPanel extends JPanel implements MouseListener, } sgroup = seqsel.intersect(av.getAlignment(), (av.hasHiddenRows()) ? av.getHiddenRepSequences() : null); - if ((sgroup == null || sgroup.getSize() == 0) - || (colsel == null || colsel.isEmpty())) + if ((sgroup != null && sgroup.getSize() > 0)) { - // don't copy columns if the region didn't intersect. - copycolsel = false; + copycolsel = true; } } if (sgroup != null && sgroup.getSize() > 0) -- 1.7.10.2