From: Jim Procter Date: Mon, 17 Sep 2018 08:29:19 +0000 (+0100) Subject: JAL-345 add to AlignViewController API and define a keystroke listener following... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4e2f6c0857eff90e30d4b64540ce4b7265053bc9;p=jalview.git JAL-345 add to AlignViewController API and define a keystroke listener following same modifiers as select highlighted columns --- diff --git a/src/jalview/api/AlignViewControllerI.java b/src/jalview/api/AlignViewControllerI.java index a7ec69e..ef3df15 100644 --- a/src/jalview/api/AlignViewControllerI.java +++ b/src/jalview/api/AlignViewControllerI.java @@ -111,4 +111,23 @@ public interface AlignViewControllerI boolean markHighlightedColumns(boolean invert, boolean extendCurrent, boolean toggle); + /** + * + * Add highlighted sequences to selected rows. Exclude highlighted sequences + * from selected rows. toggle inclusion or exclusion of highlighted sequences. + * or add/exclude/toggle for sequences not highlighted. + * + * @param invert + * - when true, sequences that are not highlighted are added/removed + * from selection + * @param extendCurrent + * - normally true , the current selected group is modified. + * Otherwise a new selection is created + * @param toggle + * - toggle selection status for highlighted/not highlighted sequence + * @return + */ + boolean selectHighlightedSequences(boolean invert, boolean extendCurrent, + boolean toggle); + } diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index aac7801..38d04e2 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -385,22 +385,8 @@ public class AlignViewController implements AlignViewControllerI } - /** - * - * Add highlighted sequences to selected rows. Exclude highlighted sequences - * from selected rows. toggle inclusion or exclusion of highlighted sequences. - * or add/exclude/toggle for sequences not highlighted. - * - * @param invert - * - when true, sequences that are not highlighted are added/removed - * from selection - * @param extendCurrent - * - normally true , the current selected group is modified. - * Otherwise a new selection is created - * @param toggle - * - toggle selection status for highlighted/not highlighted sequence - * @return - */ + + @Override public boolean selectHighlightedSequences(boolean invert, boolean extendCurrent, boolean toggle) { diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 0fdc9f0..54e9955 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -687,6 +687,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, toggleSel); break; } + case KeyEvent.VK_K: + { + boolean toggleSel = evt.isControlDown() || evt.isMetaDown(); + boolean modifyExisting = true; // always modify, don't clear + // evt.isShiftDown(); + boolean invertHighlighted = evt.isAltDown(); + avc.selectHighlightedSequences(invertHighlighted, modifyExisting, + toggleSel); + break; + } + case KeyEvent.VK_PAGE_UP: viewport.getRanges().pageUp(); break;