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.bin.Jalview;
import jalview.gui.JvSwingUtils;
import jalview.gui.Preferences;
import jalview.io.FileFormats;
+import jalview.schemes.ResidueColourScheme;
import jalview.util.MessageManager;
import jalview.util.Platform;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
+@SuppressWarnings("serial")
public class GAlignFrame extends JInternalFrame
{
protected JMenuBar alignFrameMenuBar = new JMenuBar();
protected JMenuItem closeMenuItem = new JMenuItem();
- protected JMenu webService = new JMenu();
+ public JMenu webService = new JMenu();// BH 2019 was protected, but not
+ // sufficient for AlignFrame thread run
- protected JMenuItem webServiceNoServices;
+ public JMenuItem webServiceNoServices;// BH 2019 was protected, but not
+ // sufficient for AlignFrame thread run
protected JCheckBoxMenuItem viewBoxesMenuItem = new JCheckBoxMenuItem();
protected JMenu sortByAnnotScore = new JMenu();
- public JLabel statusBar = new JLabel();
+ public JLabel statusBar = new JLabel(); // BH 2019 was protected, but not
+ // sufficient for
+ // AlignFrame.printWriter
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();
protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem();
- protected JTabbedPane tabbedPane = jalview.jbgui.GDesktop.createTabbedPane();
+ protected JTabbedPane tabbedPane = new JTabbedPane();
protected JMenuItem reload = new JMenuItem();
protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
-
+
protected JMenuItem openFeatureSettings;
private SequenceAnnotationOrder annotationSortOrder;
private boolean showAutoCalculatedAbove = false;
- private Map<KeyStroke, JMenuItem> accelerators = new HashMap<KeyStroke, JMenuItem>();
+ private Map<KeyStroke, JMenuItem> accelerators = new HashMap<>();
private SplitContainerI splitFrame;
{
try
{
+
+ // for Web-page embedding using id=align-frame-div
+ setName("jalview-alignment");
+
jbInit();
setJMenuBar(alignFrameMenuBar);
System.err.println(e.toString());
}
- if (!Platform.isAMac())
+ if (Platform.allowMnemonics()) // was "not mac and not JS"
{
closeMenuItem.setMnemonic('C');
outputTextboxMenu.setMnemonic('T');
@Override
public void actionPerformed(ActionEvent e)
{
- copy_actionPerformed(e);
+ copy_actionPerformed();
}
};
addMenuActionAndAccelerator(keyStroke, copy, al);
@Override
public void actionPerformed(ActionEvent e)
{
- cut_actionPerformed(e);
+ cut_actionPerformed();
}
};
addMenuActionAndAccelerator(keyStroke, cut, al);
@Override
public void actionPerformed(ActionEvent e)
{
- delete_actionPerformed(e);
+ delete_actionPerformed();
}
});
vamsasStore_actionPerformed(e);
}
});
+
+ /*
+ * Translate as cDNA with sub-menu of translation tables
+ */
showTranslation
.setText(MessageManager.getString("label.translate_cDNA"));
- showTranslation.addActionListener(new ActionListener()
+ boolean first = true;
+ for (final GeneticCodeI table : GeneticCodes.getCodeTables())
{
- @Override
- public void actionPerformed(ActionEvent e)
+ JMenuItem item = new JMenuItem(table.getId() + " " + table.getName());
+ showTranslation.add(item);
+ item.addActionListener(new ActionListener()
{
- showTranslation_actionPerformed(e);
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showTranslation_actionPerformed(table);
+ }
+ });
+ if (first)
+ {
+ showTranslation.addSeparator();
}
- });
+ first = false;
+ }
+
showReverse.setText(MessageManager.getString("label.reverse"));
showReverse.addActionListener(new ActionListener()
{
featureSettings_actionPerformed(e);
}
});
+
+ /*
+ * add sub-menu of database we can fetch from
+ */
JMenuItem fetchSequence = new JMenuItem(
MessageManager.getString("label.fetch_sequences"));
fetchSequence.addActionListener(new ActionListener()
@Override
public void actionPerformed(ActionEvent e)
{
- fetchSequence_actionPerformed(e);
+ fetchSequence_actionPerformed();
}
});
associatedData_actionPerformed(e);
}
});
- loadVcf = new JMenuItem(MessageManager.getString("label.load_vcf_file"));
+ loadVcf = new JMenuItem(
+ MessageManager.getString("label.load_vcf_file"));
loadVcf.setToolTipText(MessageManager.getString("label.load_vcf"));
loadVcf.addActionListener(new ActionListener()
{
alignFrameMenuBar.add(formatMenu);
alignFrameMenuBar.add(colourMenu);
alignFrameMenuBar.add(calculateMenu);
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
alignFrameMenuBar.add(webService);
}
fileMenu.add(exportAnnotations);
fileMenu.add(loadTreeMenuItem);
fileMenu.add(associatedData);
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
fileMenu.add(loadVcf);
}
calculateMenu.addSeparator();
calculateMenu.add(expandAlignment);
calculateMenu.add(extractScores);
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
calculateMenu.addSeparator();
calculateMenu.add(runGroovy);
webServiceNoServices = new JMenuItem(
MessageManager.getString("label.no_services"));
webService.add(webServiceNoServices);
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
exportImageMenu.add(htmlMenuItem);
}
exportImageMenu.add(epsFile);
exportImageMenu.add(createPNG);
- exportImageMenu.add(createBioJS);
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
+ exportImageMenu.add(createBioJS);
exportImageMenu.add(createSVG);
}
addSequenceMenu.add(addFromFile);
}
});
- annotationColour = new JMenuItem(
+ annotationColour = new JRadioButtonMenuItem(
MessageManager.getString("action.by_annotation"));
+ annotationColour.setName(ResidueColourScheme.ANNOTATION_COLOUR);
annotationColour.addActionListener(new ActionListener()
{
@Override
{
}
- protected void copy_actionPerformed(ActionEvent e)
+ protected void copy_actionPerformed()
{
}
- protected void cut_actionPerformed(ActionEvent e)
+ protected void cut_actionPerformed()
{
}
- protected void delete_actionPerformed(ActionEvent e)
+ protected void delete_actionPerformed()
{
}
}
- public void showTranslation_actionPerformed(ActionEvent e)
+ public void showTranslation_actionPerformed(GeneticCodeI codeTable)
{
}
}
- public void fetchSequence_actionPerformed(ActionEvent e)
+ public void fetchSequence_actionPerformed()
{
}