X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGDesktop.java;fp=src%2Fjalview%2Fjbgui%2FGDesktop.java;h=e4a5905798e587d7aa0faba7e4ec0f7f9d5abc18;hb=4f30214e8098748469c6a4269ac2ed6c5750e4b0;hp=0ef3f46505e785be746dbde876b115729652bca4;hpb=9dabc02511e3a334a5749a504f57f69d6c9017bd;p=jalview.git diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index 0ef3f46..e4a5905 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -41,8 +41,10 @@ import javax.swing.JMenuItem; * @author $author$ * @version $Revision$ */ +@SuppressWarnings("serial") public class GDesktop extends JFrame { + protected static JMenu windowMenu = new JMenu(); JMenuBar desktopMenubar = new JMenuBar(); @@ -104,6 +106,7 @@ public class GDesktop extends JFrame */ public GDesktop() { + super(); try { jbInit(); @@ -113,8 +116,10 @@ public class GDesktop extends JFrame 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'); inputURLMenuItem.setMnemonic('U'); @@ -134,7 +139,7 @@ public class GDesktop extends JFrame */ private void jbInit() throws Exception { - + setName("jalview-desktop"); FileMenu.setText(MessageManager.getString("action.file")); HelpMenu.setText(MessageManager.getString("action.help")); inputLocalFileMenuItem @@ -206,7 +211,7 @@ public class GDesktop extends JFrame @Override public void actionPerformed(ActionEvent e) { - documentationMenuItem_actionPerformed(e); + documentationMenuItem_actionPerformed(); } }); this.getContentPane().setLayout(flowLayout1); @@ -361,7 +366,9 @@ public class GDesktop extends JFrame } }); - Float specversion = Float.parseFloat(System.getProperty("java.specification.version")); + Float specversion = Platform.isJS() ? Float.valueOf(8) + : Float.parseFloat( + System.getProperty("java.specification.version")); desktopMenubar.add(FileMenu); desktopMenubar.add(toolsMenu); @@ -377,15 +384,18 @@ public class GDesktop extends JFrame FileMenu.add(quit); HelpMenu.add(aboutMenuItem); HelpMenu.add(documentationMenuItem); - if (!Platform.isAMac() || specversion < 11) + if (!Platform.isAMacAndNotJS() || specversion < 11) { toolsMenu.add(preferences); } - toolsMenu.add(showMemusage); - toolsMenu.add(showConsole); - toolsMenu.add(showNews); - toolsMenu.add(garbageCollect); - toolsMenu.add(groovyShell); + if (!Platform.isJS()) + { + toolsMenu.add(showMemusage); + toolsMenu.add(showConsole); + toolsMenu.add(showNews); + toolsMenu.add(garbageCollect); + toolsMenu.add(groovyShell); + } toolsMenu.add(experimentalFeatures); // toolsMenu.add(snapShotWindow); inputMenu.add(inputLocalFileMenuItem); @@ -496,13 +506,7 @@ public class GDesktop extends JFrame { } - /** - * DOCUMENT ME! - * - * @param e - * DOCUMENT ME! - */ - protected void documentationMenuItem_actionPerformed(ActionEvent e) + protected void documentationMenuItem_actionPerformed() { }