JAL-468 JAL-936 sort alignment by tree and autosort for new tree
[jalview.git] / src / jalview / jbgui / GAlignFrame.java
index 9260b23..22d27e9 100755 (executable)
@@ -221,6 +221,8 @@ public class GAlignFrame extends JInternalFrame
 
   protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
 
+  protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem();
+
   JMenu addSequenceMenu = new JMenu();
 
   JMenuItem addFromFile = new JMenuItem();
@@ -1403,6 +1405,18 @@ 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);
+      }
+    });
+    
     addSequenceMenu.setText("Add Sequences");
     addFromFile.setText("From File");
     addFromFile.addActionListener(new ActionListener()
@@ -1749,6 +1763,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>");
@@ -2266,6 +2281,11 @@ public class GAlignFrame extends JInternalFrame
 
   }
 
+  public void sortByTreeOption_actionPerformed(ActionEvent e)
+  {
+
+  }
+
   public void showAllSeqs_actionPerformed(ActionEvent e)
   {