From be568293756d8c194d16d0166fd4396fa3cd9b26 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 5 Nov 2019 17:07:33 +0000 Subject: [PATCH] JAL-3120 JAL-3130 can't read "java.specification.version" in JalviewJS --- src/jalview/gui/Desktop.java | 20 +++++++++----------- src/jalview/util/ShortcutKeyMaskExWrapper.java | 5 +++-- 2 files changed, 12 insertions(+), 13 deletions(-) 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) -- 1.7.10.2