X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGAlignFrame.java;h=0ee03bc84fde7d42a85c03679c211a9fc268a571;hb=8956fdfd008d0d949814c4680a7b3a55969e39e1;hp=86d0c85b201dae4cef8f9ed9748dc73f8b0b2fd4;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 86d0c85..0ee03bc 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -21,6 +21,8 @@ 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; @@ -75,7 +77,7 @@ public class GAlignFrame extends JInternalFrame protected JMenu sortByAnnotScore = new JMenu(); - public JLabel statusBar = new JLabel(); + protected JLabel statusBar = new JLabel(); protected JMenu outputTextboxMenu = new JMenu(); @@ -137,7 +139,7 @@ public class GAlignFrame extends JInternalFrame protected JCheckBoxMenuItem showDbRefsMenuitem = new JCheckBoxMenuItem(); - protected JMenuItem showTranslation = new JMenuItem(); + protected JMenu showTranslation = new JMenu(); protected JMenuItem showReverse = new JMenuItem(); @@ -147,6 +149,8 @@ public class GAlignFrame extends JInternalFrame protected JMenuItem runGroovy = new JMenuItem(); + protected JMenuItem loadVcf; + protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem(); protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem(); @@ -199,7 +203,7 @@ public class GAlignFrame extends JInternalFrame private boolean showAutoCalculatedAbove = false; - private Map accelerators = new HashMap(); + private Map accelerators = new HashMap<>(); private SplitContainerI splitFrame; @@ -1219,16 +1223,33 @@ public class GAlignFrame extends JInternalFrame 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() { @@ -1308,6 +1329,16 @@ public class GAlignFrame extends JInternalFrame associatedData_actionPerformed(e); } }); + loadVcf = new JMenuItem(MessageManager.getString("label.load_vcf_file")); + loadVcf.setToolTipText(MessageManager.getString("label.load_vcf")); + loadVcf.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + loadVcf_actionPerformed(); + } + }); autoCalculate.setText( MessageManager.getString("label.autocalculate_consensus")); autoCalculate.setState( @@ -1710,6 +1741,7 @@ public class GAlignFrame extends JInternalFrame fileMenu.add(exportAnnotations); fileMenu.add(loadTreeMenuItem); fileMenu.add(associatedData); + fileMenu.add(loadVcf); fileMenu.addSeparator(); fileMenu.add(closeMenuItem); @@ -1855,6 +1887,10 @@ public class GAlignFrame extends JInternalFrame // selectMenu.add(listenToViewSelections); } + protected void loadVcf_actionPerformed() + { + } + /** * Constructs the entries on the Colour menu (but does not add them to the * menu). @@ -2423,7 +2459,7 @@ public class GAlignFrame extends JInternalFrame } - public void showTranslation_actionPerformed(ActionEvent e) + public void showTranslation_actionPerformed(GeneticCodeI codeTable) { }