From: Jim Procter Date: Tue, 7 Oct 2014 16:26:35 +0000 (+0100) Subject: JAL-1557 partial implementation - need to think about how to do SHIFT+double click... X-Git-Tag: Jalview_2_9~171^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7e8241cdc284ef2586e36a3abbe3bd385dad10dc;p=jalview.git JAL-1557 partial implementation - need to think about how to do SHIFT+double click type range selections --- diff --git a/src/jalview/appletgui/AnnotationLabels.java b/src/jalview/appletgui/AnnotationLabels.java index b5ebbbe..ac62c6b 100755 --- a/src/jalview/appletgui/AnnotationLabels.java +++ b/src/jalview/appletgui/AnnotationLabels.java @@ -660,9 +660,22 @@ public class AnnotationLabels extends Panel implements ActionListener, SequenceGroup sg = ap.av.getSelectionGroup(); if (sg!=null) { + // we make a copy rather than edit the current selection if no modifiers pressed + // see Enhancement JAL-1557 + if (!(evt.isControlDown() || evt.isShiftDown())) + { sg = new SequenceGroup(sg); sg.clear(); sg.addSequence(aa[selectedRow].sequenceRef, false); + } else { + if (evt.isControlDown()) + { + sg.addOrRemove(aa[selectedRow].sequenceRef, true); + } else { + // notionally, we should also add intermediate sequences from last added sequence ? + sg.addSequence(aa[selectedRow].sequenceRef, true); + } + } } else { sg = new SequenceGroup(); sg.setStartRes(0); diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 7aa3ae3..fdb3975 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -521,9 +521,22 @@ public class AnnotationLabels extends JPanel implements MouseListener, SequenceGroup sg = ap.av.getSelectionGroup(); if (sg!=null) { + // we make a copy rather than edit the current selection if no modifiers pressed + // see Enhancement JAL-1557 + if (!(evt.isControlDown() || evt.isShiftDown())) + { sg = new SequenceGroup(sg); sg.clear(); sg.addSequence(aa[selectedRow].sequenceRef, false); + } else { + if (evt.isControlDown()) + { + sg.addOrRemove(aa[selectedRow].sequenceRef, true); + } else { + // notionally, we should also add intermediate sequences from last added sequence ? + sg.addSequence(aa[selectedRow].sequenceRef, true); + } + } } else { sg = new SequenceGroup(); sg.setStartRes(0);