From 73bbb197d06410544f7cc115e0d00e4456ed714a Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 21 Apr 2014 17:23:57 +0100 Subject: [PATCH] JAL-1485 JAL-1473 use compound i18n messages to construct title of tree using translations of score model and calculation method --- resources/lang/Messages.properties | 9 +++++++++ src/jalview/gui/AlignFrame.java | 29 ++++++++++++++++++----------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 8356ebf..775df57 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -165,6 +165,15 @@ label.redo_command = Redo {0} label.principal_component_analysis = Principal Component Analysis label.average_distance_identity = Average Distance Using % Identity label.neighbour_joining_identity = Neighbour Joining Using % Identity +label.treecalc_title = {0} Using {1} +label.tree_calc_av = Average Distance +label.tree_calc_nj = Neighbour Joining +label.select_score_model = Select score model +label.score_model_pid = % Identity +label.score_model_blosum62 = BLOSUM62 +label.score_model_pam250 = PAM 250 +label.score_model_conservation = Physicochemical property conservation +label.score_model_enhconservation = Physicochemical property conservation label.status_bar = Status bar label.out_to_textbox = Output to Textbox label.clustalx = Clustalx diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 3f9ebaf..da34013 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -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); + } } } -- 1.7.10.2