package jalview.jbgui;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.analysis.GeneticCodeI;
+import jalview.analysis.GeneticCodes;
import jalview.api.SplitContainerI;
import jalview.bin.Cache;
import jalview.gui.JvSwingUtils;
import jalview.gui.Preferences;
import jalview.io.FileFormats;
+import jalview.schemes.ResidueColourScheme;
import jalview.util.MessageManager;
import jalview.util.Platform;
protected JMenu sortByAnnotScore = new JMenu();
- public JLabel statusBar = new JLabel();
+ protected JLabel statusBar = new JLabel();
protected JMenu outputTextboxMenu = new JMenu();
protected JMenuItem modifyPID;
- protected JMenuItem annotationColour;
+ protected JRadioButtonMenuItem annotationColour;
protected JMenu sortByTreeMenu = new JMenu();
protected JCheckBoxMenuItem showDbRefsMenuitem = new JCheckBoxMenuItem();
- protected JMenuItem showTranslation = new JMenuItem();
+ protected JMenu showTranslation = new JMenu();
protected JMenuItem showReverse = new JMenuItem();
private boolean showAutoCalculatedAbove = false;
- private Map<KeyStroke, JMenuItem> accelerators = new HashMap<KeyStroke, JMenuItem>();
+ private Map<KeyStroke, JMenuItem> accelerators = new HashMap<>();
private SplitContainerI splitFrame;
vamsasStore_actionPerformed(e);
}
});
- showTranslation
- .setText(MessageManager.getString("label.translate_cDNA"));
- showTranslation.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
+
+ /*
+ * Translate as cDNA with sub-menu of translation tables
+ */
+ showTranslation.setText(MessageManager
+ .getString("label.translate_cDNA"));
+ boolean first = true;
+ for (final GeneticCodeI table : GeneticCodes.getInstance()
+ .getCodeTables())
+ {
+ JMenuItem item = new JMenuItem(table.getId() + " " + table.getName());
+ showTranslation.add(item);
+ item.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showTranslation_actionPerformed(table);
+ }
+ });
+ if (first)
{
- showTranslation_actionPerformed(e);
+ showTranslation.addSeparator();
}
- });
+ first = false;
+ }
+
showReverse.setText(MessageManager.getString("label.reverse"));
showReverse.addActionListener(new ActionListener()
{
}
});
- annotationColour = new JMenuItem(
+ annotationColour = new JRadioButtonMenuItem(
MessageManager.getString("action.by_annotation"));
+ annotationColour.setName(ResidueColourScheme.ANNOTATION_COLOUR);
annotationColour.addActionListener(new ActionListener()
{
@Override
}
- public void showTranslation_actionPerformed(ActionEvent e)
+ public void showTranslation_actionPerformed(GeneticCodeI codeTable)
{
}