From a3f13508626aa8190ecc10eed9d7ebf6a177c2a4 Mon Sep 17 00:00:00 2001 From: hansonr Date: Wed, 15 May 2019 18:26:47 -0500 Subject: [PATCH] JAL-3253-applet Platform getDocumentBase() and getCodeBase() as if applet fixed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit uses g.秘html5Applet instead of J2S.thisApplet --- src/jalview/util/Platform.java | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) 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; } } -- 1.7.10.2