package jalview.jbgui;
import jalview.api.AlignmentViewPanel;
+import jalview.bin.Jalview;
import jalview.io.FileFormatException;
import jalview.util.MessageManager;
import jalview.util.Platform;
*/
public class GDesktop extends JFrame
{
+
+ public static javax.swing.JTabbedPane createTabbedPane()
+ {
+ // now just always return JTabbedPane
+ return new javax.swing.JTabbedPane();
+// // BH 2018 coercing jalview.jbgui.swing.JTabbedPane() for now
+// if (/** @j2sNative false && */
+// true)
+// {
+// // Java
+// return new javax.swing.JTabbedPane();
+// }
+// // JavaScript
+// return (javax.swing.JTabbedPane) (Object) new jalview.jbgui.swing.JTabbedPane();
+ }
+
+
protected static JMenu windowMenu = new JMenu();
JMenuBar desktopMenubar = new JMenuBar();
*/
public GDesktop()
{
+ super();
try
{
jbInit();
e.printStackTrace();
}
- if (!Platform.isAMac())
+ if (Platform.allowMnemonics())
{
+ //BH was !Platform.isAMacAndNotJS()) i.e. "JS or not Mac"
+ // but here we want just not a Mac, period, right?
FileMenu.setMnemonic('F');
inputLocalFileMenuItem.setMnemonic('L');
- VamsasMenu.setMnemonic('V');
+ VamsasMenu.setMnemonic('V');
inputURLMenuItem.setMnemonic('U');
inputTextboxMenuItem.setMnemonic('C');
quit.setMnemonic('Q');
@Override
public void actionPerformed(ActionEvent e)
{
- documentationMenuItem_actionPerformed(e);
+ documentationMenuItem_actionPerformed();
}
});
this.getContentPane().setLayout(flowLayout1);
@Override
public void actionPerformed(ActionEvent e)
{
- saveState_actionPerformed(e);
+ saveState_actionPerformed(true);
+ }
+ });
+ JMenuItem saveAsJaxb = new JMenuItem("Save Project as JAXB");
+ saveAsJaxb.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ saveState_actionPerformed(false);
}
});
loadState.setText(MessageManager.getString("action.load_project"));
@Override
public void actionPerformed(ActionEvent e)
{
- loadState_actionPerformed(e);
+ loadState_actionPerformed(true);
+ }
+ });
+ JMenuItem loadAsJaxb = new JMenuItem("Load Project as JAXB");
+ loadAsJaxb.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ loadState_actionPerformed(false);
}
});
inputMenu.setText(MessageManager.getString("label.input_alignment"));
FileMenu.add(inputMenu);
FileMenu.add(inputSequence);
FileMenu.addSeparator();
- FileMenu.add(saveState);
- FileMenu.add(loadState);
+ FileMenu.add(saveAsJaxb);
+ FileMenu.add(loadAsJaxb);
+ if (!Jalview.isJS())
+ {
+ FileMenu.add(saveState);
+ FileMenu.add(loadState);
+ }
FileMenu.addSeparator();
FileMenu.add(quit);
HelpMenu.add(aboutMenuItem);
VamsasMenu.add(vamsasSave);
VamsasMenu.add(vamsasStop);
toolsMenu.add(preferences);
- toolsMenu.add(showMemusage);
- toolsMenu.add(showConsole);
- toolsMenu.add(showNews);
- toolsMenu.add(garbageCollect);
- toolsMenu.add(groovyShell);
+ if (!Jalview.isJS())
+ {
+ toolsMenu.add(showMemusage);
+ toolsMenu.add(showConsole);
+ }
+ if (!Jalview.isJS())
+ {
+ toolsMenu.add(showNews);
+ toolsMenu.add(garbageCollect);
+ toolsMenu.add(groovyShell);
+ }
toolsMenu.add(experimentalFeatures);
// toolsMenu.add(snapShotWindow);
inputMenu.add(inputLocalFileMenuItem);
{
}
- /**
- * DOCUMENT ME!
- *
- * @param e
- * DOCUMENT ME!
- */
- protected void documentationMenuItem_actionPerformed(ActionEvent e)
+ protected void documentationMenuItem_actionPerformed()
{
}
* @param e
* DOCUMENT ME!
*/
- public void saveState_actionPerformed(ActionEvent e)
+ public void saveState_actionPerformed(boolean asCastor)
{
}
* @param e
* DOCUMENT ME!
*/
- public void loadState_actionPerformed(ActionEvent e)
+ public void loadState_actionPerformed(boolean asCastor)
{
}