JAL-1485 JAL-1473 use compound i18n messages to construct title of tree using transla...
authorJim Procter <jprocter@dundee.ac.uk>
Mon, 21 Apr 2014 16:23:57 +0000 (17:23 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Mon, 21 Apr 2014 16:23:57 +0000 (17:23 +0100)
resources/lang/Messages.properties
src/jalview/gui/AlignFrame.java

index 8356ebf..775df57 100644 (file)
@@ -165,6 +165,15 @@ label.redo_command = Redo {0}
 label.principal_component_analysis = Principal Component Analysis\r
 label.average_distance_identity = Average Distance Using % Identity\r
 label.neighbour_joining_identity = Neighbour Joining Using % Identity\r
+label.treecalc_title = {0} Using {1}\r
+label.tree_calc_av = Average Distance\r
+label.tree_calc_nj = Neighbour Joining\r
+label.select_score_model = Select score model\r
+label.score_model_pid = % Identity\r
+label.score_model_blosum62 = BLOSUM62\r
+label.score_model_pam250 = PAM 250\r
+label.score_model_conservation = Physicochemical property conservation\r
+label.score_model_enhconservation = Physicochemical property conservation\r
 label.status_bar = Status bar\r
 label.out_to_textbox = Output to Textbox\r
 label.clustalx = Clustalx\r
index 3f9ebaf..da34013 100644 (file)
@@ -3945,23 +3945,30 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     calculateTree.removeAll();
     // build the calculate menu
+    
     for (final String type:new String[] {"NJ", "AV"})
     {
+      String treecalcnm = MessageManager.getString("label.tree_calc_"+type.toLowerCase());
       for (final Object pwtype: ResidueProperties.scoreMatrices.keySet())
       {
         JMenuItem tm = new JMenuItem();
         ScoreModelI sm = 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);
+        if (sm.isProtein()==!viewport.getAlignment().isNucleotide())
+        {
+          String smn = MessageManager.getStringOrReturn(
+                  "label.score_model_", sm.getName());
+          final String title = MessageManager.formatMessage(
+                  "label.treecalc_title", treecalcnm, smn);
+          tm.setText(title);//
+          tm.addActionListener(new java.awt.event.ActionListener()
+          {
+            public void actionPerformed(ActionEvent e)
+            {
+              NewTreePanel(type, (String) pwtype, title);
+            }
+          });
+          calculateTree.add(tm);
+        }
 
       }
     }