From f3226d82fed697cb41c626a5204bb3b56add70c3 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 2 Nov 2016 16:29:44 +0000 Subject: [PATCH] JAL-345 JAL-1738 menu item, AlignFrame action listener and documentation for Select->Select Highlighted Regions. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Accelerator key (CMD-L) doesn’t seem to work right now. --- help/html/features/chimera.html | 7 +++++++ help/html/menus/alignmentMenu.html | 7 +++++++ help/html/menus/alwselect.html | 7 +++++++ resources/lang/Messages.properties | 1 + src/jalview/gui/AlignFrame.java | 10 ++++++++++ src/jalview/jbgui/GAlignFrame.java | 22 ++++++++++++++++++++++ 6 files changed, 54 insertions(+) diff --git a/help/html/features/chimera.html b/help/html/features/chimera.html index 1b0b9c1..257c84c 100644 --- a/help/html/features/chimera.html +++ b/help/html/features/chimera.html @@ -68,6 +68,13 @@ Chimera window, they are highlighted on the alignment. For comprehensive details of Chimera's commands, refer to the tool's Help menu. + +

+ Selecting residues in Jalview from Chimera
+ When a selection is highlighted in a Jalview window, use the Select→Select + Highlighted Region function to create a column selection for the + mapped positions in the sequence alignment. +

Basic screen operations (see Chimera diff --git a/help/html/menus/alignmentMenu.html b/help/html/menus/alignmentMenu.html index c8b2270..24f8239 100755 --- a/help/html/menus/alignmentMenu.html +++ b/help/html/menus/alignmentMenu.html @@ -278,6 +278,13 @@ Columns by Annotation
Select or Hide columns in the alignment according to secondary structure, labels and values shown in alignment annotation rows. +

  • Select Highlighted Columns
    Selects + the columns currently highlighted as a result of a find, mouse + over, or selection event from a linked structure viewer or other + application. Modifiers will work on some platforms: SHIFT will + add columns to selection, ALT will invert the highlighted set + before selection, and CTRL (or META) will toggle the selection. +
  • View diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index bcbc24b..8739d74 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -125,6 +125,7 @@ action.change_font_tree_panel = Change Font (Tree Panel) action.colour = Colour action.calculate = Calculate action.select_all = Select all +action.select_highlighted_columns = Select Highlighted Columns action.deselect_all = Deselect all action.invert_selection = Invert selection action.using_jmol = Using Jmol diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 7dff2ac..8a09c1d 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -5929,6 +5929,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } return false; } + + @Override + protected void selectHighlightedColumns_actionPerformed( + ActionEvent actionEvent) + { + avc.markHighlightedColumns( + (actionEvent.getModifiers() & ActionEvent.ALT_MASK) != 0, + (actionEvent.getModifiers() & ActionEvent.SHIFT_MASK) != 0, + (actionEvent.getModifiers() & ActionEvent.CTRL_MASK) != 0); + } } class PrintThread extends Thread diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 6b94559..d6474f1 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -2181,6 +2181,20 @@ public class GAlignFrame extends JInternalFrame alignmentProperties(); } }); + JMenuItem selectHighlighted = new JMenuItem( + MessageManager.getString("label.select_highlighted_columns")); + keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_L, Toolkit + .getDefaultToolkit().getMenuShortcutKeyMask(), false); + al = new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + selectHighlightedColumns_actionPerformed(actionEvent); + } + }; + addMenuActionAndAccelerator(keyStroke, selectHighlighted, al); + JMenu tooltipSettingsMenu = new JMenu( MessageManager.getString("label.sequence_id_tooltip")); JMenu autoAnnMenu = new JMenu( @@ -2382,12 +2396,20 @@ public class GAlignFrame extends JInternalFrame selectMenu.add(grpsFromSelection); selectMenu.add(deleteGroups); selectMenu.add(annotationColumn); + selectMenu.add(selectHighlighted); // TODO - determine if the listenToViewSelections button is needed : see bug // JAL-574 // selectMenu.addSeparator(); // selectMenu.add(listenToViewSelections); } + protected void selectHighlightedColumns_actionPerformed( + ActionEvent actionEvent) + { + // TODO Auto-generated method stub + + } + /** * Generate the reverse sequence (or reverse complement if the flag is true) * and add it to the alignment -- 1.7.10.2