From 80b5ead1e8730095c8a58ab92f0a7bab5bf99857 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 31 Aug 2020 17:49:18 +0100 Subject: [PATCH] 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 --- src/jalview/gui/AlignFrame.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) 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); -- 1.7.10.2