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: Release_2_11_1_1~18 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d603dfa09e451bde0b376798f68d60c2708dd2b8;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 5e16397..4be7d0e 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1749,10 +1749,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) { @@ -1760,8 +1760,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);