Merge remote-tracking branch 'remotes/origin/2_5_1_rna_merge' into develop (JAL-826)
[jalview.git] / src / jalview / jbgui / GAlignFrame.java
index 7eb4693..4f60de3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -228,6 +228,10 @@ public class GAlignFrame extends JInternalFrame
 
   protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
 
+  protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem();
+
+  protected JCheckBoxMenuItem listenToViewSelections = new JCheckBoxMenuItem();
+
   JMenu addSequenceMenu = new JMenu();
 
   JMenuItem addFromFile = new JMenuItem();
@@ -1457,6 +1461,29 @@ public class GAlignFrame extends JInternalFrame
         autoCalculate_actionPerformed(e);
       }
     });
+    sortByTree.setText("Sort Alignment With New Tree");
+    sortByTree.setToolTipText("<html>Enable this to automatically sort<br>the alignment when you open<br> a new tree.");
+    sortByTree.setState(jalview.bin.Cache.getDefault(
+            "SORT_BY_TREE", false));
+    sortByTree.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        sortByTreeOption_actionPerformed(e);
+      }
+    });
+
+    listenToViewSelections.setText("Listen for selections");
+    listenToViewSelections.setToolTipText("<html>When selected, selections in this view will mirror<br>selections made on the same sequences in other views.");
+    listenToViewSelections.setState(false); 
+    listenToViewSelections.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        listenToViewSelections_actionPerformed(e);
+      }
+    });
+
     addSequenceMenu.setText("Add Sequences");
     addFromFile.setText("From File");
     addFromFile.addActionListener(new ActionListener()
@@ -1806,6 +1833,7 @@ public class GAlignFrame extends JInternalFrame
     calculateMenu.add(showTranslation);
     calculateMenu.add(showProducts);
     calculateMenu.add(autoCalculate);
+    calculateMenu.add(sortByTree);
     calculateMenu.addSeparator();
     calculateMenu.add(extractScores);
     webServiceNoServices = new JMenuItem("<No Services>");
@@ -1861,6 +1889,15 @@ public class GAlignFrame extends JInternalFrame
     selectMenu.add(invertColSel);
     selectMenu.add(deleteGroups);
     selectMenu.add(grpsFromSelection);
+    // TODO - determine if the listenToViewSelections button is needed : see bug JAL-574
+    //selectMenu.addSeparator();
+    //selectMenu.add(listenToViewSelections);
+  }
+
+  protected void listenToViewSelections_actionPerformed(ActionEvent e)
+  {
+    // TODO Auto-generated method stub
+    
   }
 
   protected void showAllhidden_actionPerformed(ActionEvent e)
@@ -2336,6 +2373,11 @@ public class GAlignFrame extends JInternalFrame
 
   }
 
+  public void sortByTreeOption_actionPerformed(ActionEvent e)
+  {
+
+  }
+
   public void showAllSeqs_actionPerformed(ActionEvent e)
   {