JAL-345 JAL-1738 menu item, AlignFrame action listener and documentation for Select...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 2 Nov 2016 16:29:44 +0000 (16:29 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 2 Nov 2016 16:29:44 +0000 (16:29 +0000)
Accelerator key (CMD-L) doesn’t seem to work right now.

help/html/features/chimera.html
help/html/menus/alignmentMenu.html
help/html/menus/alwselect.html
resources/lang/Messages.properties
src/jalview/gui/AlignFrame.java
src/jalview/jbgui/GAlignFrame.java

index 1b0b9c1..257c84c 100644 (file)
     Chimera window, they are highlighted on the alignment. For
     comprehensive details of Chimera's commands, refer to the tool's
     Help menu.
     Chimera window, they are highlighted on the alignment. For
     comprehensive details of Chimera's commands, refer to the tool's
     Help menu.
+  
+  <p>
+    <strong>Selecting residues in Jalview from Chimera</strong><br />
+    When a selection is highlighted in a Jalview window, use the <em>Select&#8594;Select
+      Highlighted Region</em> function to create a column selection for the
+    mapped positions in the sequence alignment.
+  </p>
   <p>
     Basic screen operations (see <a
       href="http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/mouse.html">Chimera
   <p>
     Basic screen operations (see <a
       href="http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/mouse.html">Chimera
index c8b2270..24f8239 100755 (executable)
               Columns by Annotation</a></strong> <br /> <em>Select or Hide
             columns in the alignment according to secondary structure,
             labels and values shown in alignment annotation rows. </em></li>
               Columns by Annotation</a></strong> <br /> <em>Select or Hide
             columns in the alignment according to secondary structure,
             labels and values shown in alignment annotation rows. </em></li>
+        <li><strong>Select Highlighted Columns</strong> <br /> <em>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.
+        </em></li>
       </ul></li>
     <li><strong>View</strong>
       <ul>
       </ul></li>
     <li><strong>View</strong>
       <ul>
index b93f85b..0318818 100644 (file)
           Columns by Annotation</a></strong> <br /> <em>Select or Hide columns
         in the alignment according to secondary structure, labels and
         values shown in alignment annotation rows. </em></li>
           Columns by Annotation</a></strong> <br /> <em>Select or Hide columns
         in the alignment according to secondary structure, labels and
         values shown in alignment annotation rows. </em></li>
+    <li><strong>Select Highlighted Columns</strong> <br /> <em>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.
+    </em></li>
   </ul>
 </body>
 </html>
   </ul>
 </body>
 </html>
index bcbc24b..8739d74 100644 (file)
@@ -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.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
 action.deselect_all = Deselect all
 action.invert_selection = Invert selection
 action.using_jmol = Using Jmol
index 7dff2ac..8a09c1d 100644 (file)
@@ -5929,6 +5929,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
     return false;
   }
     }
     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
 }
 
 class PrintThread extends Thread
index 6b94559..d6474f1 100755 (executable)
@@ -2181,6 +2181,20 @@ public class GAlignFrame extends JInternalFrame
         alignmentProperties();
       }
     });
         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(
     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(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);
   }
 
     // 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
   /**
    * Generate the reverse sequence (or reverse complement if the flag is true)
    * and add it to the alignment