From: Jim Procter Date: Mon, 21 Apr 2014 16:26:52 +0000 (+0100) Subject: JAL-1485 JAL-1483 show i18n key for different available score models, and limit to... X-Git-Tag: Jalview_2_9~198^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c460f6a6a2040f07ea8296af95107a8b3a3b6de2;p=jalview.git JAL-1485 JAL-1483 show i18n key for different available score models, and limit to those applicable for a protein / DNA --- diff --git a/src/jalview/gui/PCAPanel.java b/src/jalview/gui/PCAPanel.java index fc32e54..38fd74d 100644 --- a/src/jalview/gui/PCAPanel.java +++ b/src/jalview/gui/PCAPanel.java @@ -115,26 +115,29 @@ public class PCAPanel extends GPCAPanel implements Runnable, protected void scoreMatrix_menuSelected() { scoreMatrixMenu.removeAll(); - for (final Object sm:ResidueProperties.scoreMatrices.keySet()) + for (final String sm:ResidueProperties.scoreMatrices.keySet()) { - JMenuItem jm=new JMenuItem(); - jm.setText((String)sm); - jm.setSelected(pcaModel.getScore_matrix().equals((String)sm)); - final PCAPanel us = this; - jm.addActionListener(new ActionListener() + JCheckBoxMenuItem jm=new JCheckBoxMenuItem(); + jm.setText(MessageManager.getStringOrReturn("label.score_model", sm)); + jm.setSelected(pcaModel.getScore_matrix().equals(sm)); + if (pcaModel.isNucleotide()==ResidueProperties.scoreMatrices.get(sm).isDNA()) { - @Override - public void actionPerformed(ActionEvent e) + final PCAPanel us = this; + jm.addActionListener(new ActionListener() { - if (!pcaModel.getScore_matrix().equals((String)sm)) + @Override + public void actionPerformed(ActionEvent e) { - pcaModel.setScore_matrix((String) sm); - Thread worker = new Thread(us); - worker.start(); + if (!pcaModel.getScore_matrix().equals((String) sm)) + { + pcaModel.setScore_matrix((String) sm); + Thread worker = new Thread(us); + worker.start(); + } } - } - }); - scoreMatrixMenu.add(jm); + }); + scoreMatrixMenu.add(jm); + } } } public void bgcolour_actionPerformed(ActionEvent e)