JAL-3253-applet Platform getDocumentBase() and getCodeBase() as if
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Wed, 15 May 2019 23:26:47 +0000 (18:26 -0500)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Wed, 15 May 2019 23:26:47 +0000 (18:26 -0500)
applet fixed

uses g.秘html5Applet instead of J2S.thisApplet

src/jalview/util/Platform.java

index 0c962f7..9b57a5a 100644 (file)
@@ -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;
   }
 
 }