JAL-1473 menu entries for different score models available for NJ/UPGMA tree building...
authorJim Procter <jprocter@dundee.ac.uk>
Tue, 15 Apr 2014 15:19:50 +0000 (16:19 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Mon, 21 Apr 2014 13:09:16 +0000 (14:09 +0100)
src/jalview/gui/AlignFrame.java
src/jalview/jbgui/GAlignFrame.java

index d11bd31..5160a3a 100644 (file)
@@ -72,6 +72,7 @@ import jalview.schemes.PIDColourScheme;
 import jalview.schemes.PurinePyrimidineColourScheme;
 import jalview.schemes.RNAHelicesColourChooser;
 import jalview.schemes.ResidueProperties;
+import jalview.schemes.ScoreMatrix;
 import jalview.schemes.StrandColourScheme;
 import jalview.schemes.TCoffeeColourScheme;
 import jalview.schemes.TaylorColourScheme;
@@ -327,6 +328,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     setMenusFromViewport(viewport);
     buildSortByAnnotationScoresMenu();
+    buildTreeMenu();
     if (viewport.wrapAlignment)
     {
       wrapMenuItem_actionPerformed(null);
@@ -3888,6 +3890,28 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void buildTreeMenu()
   {
+    calculateTree.removeAll();
+    // build the calculate menu
+    for (final String type:new String[] {"NJ", "AV"})
+    {
+      for (final Object pwtype: ResidueProperties.scoreMatrices.keySet())
+      {
+        JMenuItem tm = new JMenuItem();
+        ScoreMatrix sm = (ScoreMatrix) ResidueProperties.scoreMatrices.get(pwtype);
+        final String title="Calculate "+type+" using "+sm.getName();
+        tm.setText(title);// MessageManager.getString("label.neighbour_blosum62"));
+        tm
+                .addActionListener(new java.awt.event.ActionListener()
+                {
+                  public void actionPerformed(ActionEvent e)
+                  {
+                    NewTreePanel(type, (String) pwtype, title);
+                  }
+                });
+        calculateTree.add(tm);
+
+      }
+    }
     sortByTreeMenu.removeAll();
 
     Vector comps = (Vector) PaintRefresher.components.get(viewport
index ee6ba9f..13ec23f 100755 (executable)
@@ -1930,10 +1930,6 @@ public class GAlignFrame extends JInternalFrame
     sort.add(sortGroupMenuItem);
     sort.add(sortPairwiseMenuItem);
     sort.add(sortByTreeMenu);
-    calculateTree.add(averageDistanceTreeMenuItem);
-    calculateTree.add(neighbourTreeMenuItem);
-    calculateTree.add(avDistanceTreeBlosumMenuItem);
-    calculateTree.add(njTreeBlosumMenuItem);
     jMenu2.add(htmlMenuItem);
     jMenu2.add(epsFile);
     jMenu2.add(createPNG);