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)