From 8f49f494744e8e19b6ca0ba6b9b46bfa5f4a55e0 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 15 Apr 2014 16:19:50 +0100 Subject: [PATCH] JAL-1473 menu entries for different score models available for NJ/UPGMA tree building (note - this will not scale well!) --- src/jalview/gui/AlignFrame.java | 24 ++++++++++++++++++++++++ src/jalview/jbgui/GAlignFrame.java | 4 ---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index d11bd31..5160a3a 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -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 diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index ee6ba9f..13ec23f 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -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); -- 1.7.10.2