From: hansonr Date: Wed, 15 May 2019 23:26:47 +0000 (-0500) Subject: JAL-3253-applet Platform getDocumentBase() and getCodeBase() as if X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a3f13508626aa8190ecc10eed9d7ebf6a177c2a4;p=jalview.git JAL-3253-applet Platform getDocumentBase() and getCodeBase() as if applet fixed uses g.秘html5Applet instead of J2S.thisApplet --- diff --git a/src/jalview/util/Platform.java b/src/jalview/util/Platform.java index 0c962f7..9b57a5a 100644 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@ -621,30 +621,40 @@ public class Platform { try { - return (isJS() ? new URL(/** - * @j2sNative J2S.thisApplet._applet.appletViewer.appletDocumentBase - * || - */ - "") : null); + if (isJS()) + { + @SuppressWarnings("unused") + Object g = Thread.currentThread().getThreadGroup(); + return new URL(/** + * @j2sNative g.秘html5Applet._appletPanel.appletDocumentBase + * || + */ + ""); + } } catch (MalformedURLException e) { - return null; } + return null; } public static URL getCodeBase() { try { - return (isJS() ? new URL(/** - * @j2sNative J2S.thisApplet._applet.appletViewer.appletCodeBase - * || - */ - "") : null); + if (isJS()) + { + @SuppressWarnings("unused") + Object g = Thread.currentThread().getThreadGroup(); + return new URL(/** + * @j2sNative g.秘html5Applet._appletPanel.appletCodeBase + * || + */ + ""); + } } catch (MalformedURLException e) { - return null; } + return null; } }