From: gmungoc Date: Tue, 5 Nov 2019 17:07:33 +0000 (+0000) Subject: JAL-3120 JAL-3130 can't read "java.specification.version" in JalviewJS X-Git-Tag: Release_2_11_4_0~45^2~18^2~78^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=be568293756d8c194d16d0166fd4396fa3cd9b26;p=jalview.git JAL-3120 JAL-3130 can't read "java.specification.version" in JalviewJS --- diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 5800a47..ec6b795 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -367,20 +367,18 @@ public class Desktop extends jalview.jbgui.GDesktop } */ - try - { - APQHandlers.setAPQHandlers(this); - } catch (Exception e) - { - System.out.println("Cannot set APQHandlers"); - // e.printStackTrace(); - } catch (Throwable t) + if (!Platform.isJS()) { - System.out.println("Cannot set APQHandlers"); - // t.printStackTrace(); + try + { + APQHandlers.setAPQHandlers(this); + } catch (Throwable t) + { + System.out.println("Error setting APQHandlers: " + t.toString()); + // t.printStackTrace(); + } } - addWindowListener(new WindowAdapter() { diff --git a/src/jalview/util/ShortcutKeyMaskExWrapper.java b/src/jalview/util/ShortcutKeyMaskExWrapper.java index f73b8d4..c83da4e 100644 --- a/src/jalview/util/ShortcutKeyMaskExWrapper.java +++ b/src/jalview/util/ShortcutKeyMaskExWrapper.java @@ -17,8 +17,9 @@ public class ShortcutKeyMaskExWrapper static { - specversion = Float - .parseFloat(System.getProperty("java.specification.version")); + specversion = Platform.isJS() ? Float.valueOf(8) + : Float.parseFloat( + System.getProperty("java.specification.version")); modern = 11; if (specversion >= modern)