From: Jim Procter Date: Mon, 31 Aug 2020 16:49:18 +0000 (+0100) Subject: JAL-3732 - sequences can be moved up/down in cursor mode via alt-up/down arrow X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~15^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=80b5ead1e8730095c8a58ab92f0a7bab5bf99857;p=jalview.git JAL-3732 - sequences can be moved up/down in cursor mode via alt-up/down arrow JAL-3733 TODO - provide an undo for sequence/group up/down moves --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 910ab63..8e7820f 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1782,10 +1782,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } /** - * DOCUMENT ME! + * Calls AlignmentI.moveSelectedSequencesByOne with current sequence selection or the sequence under cursor in keyboard mode * * @param up - * DOCUMENT ME! + * or down (if !up) */ public void moveSelectedSequences(boolean up) { @@ -1793,8 +1793,23 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (sg == null) { - return; + if (viewport.cursorMode) + { + sg = new SequenceGroup(); + sg.addSequence(viewport.getAlignment() + .getSequenceAt(alignPanel.getSeqPanel().seqCanvas.cursorY),false); + } else { + return; + } + } + + if (sg.getSize() < 1) + { + return; } + + // TODO: JAL-3733 - add an event to the undo buffer for this ! + viewport.getAlignment().moveSelectedSequencesByOne(sg, viewport.getHiddenRepSequences(), up); alignPanel.paintAlignment(true, false);