Merge branch 'develop' into task/JAL-4001_migrate_googleanalytics_to_GA4
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 8 Jun 2023 16:21:28 +0000 (17:21 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 8 Jun 2023 16:21:28 +0000 (17:21 +0100)
1  2 
src/jalview/bin/Jalview.java

@@@ -1006,7 -1006,7 +1006,7 @@@ public class Jalvie
              ex.printStackTrace(System.err);
            }
          }
-         
          if (groovyscript != null)
          {
            // Execute the groovy script after we've done all the rendering stuff
  
    private static void setLookAndFeel()
    {
-     // property laf = "crossplatform", "system", "gtk", "metal", "nimbus",
-     // "mac" or "flat"
-     // If not set (or chosen laf fails), use the normal SystemLaF and if on Mac,
-     // try Quaqua/Vaqua.
-     String lafProp = System.getProperty("laf");
-     String lafSetting = Cache.getDefault("PREFERRED_LAF", null);
-     String laf = "none";
-     if (lafProp != null)
-     {
-       laf = lafProp;
-     }
-     else if (lafSetting != null)
-     {
-       laf = lafSetting;
-     }
-     boolean lafSet = false;
-     switch (laf)
+     if (!Platform.isJS())
+     /**
+      * Java only
+      * 
+      * @j2sIgnore
+      */
      {
-     case "crossplatform":
-       lafSet = setCrossPlatformLookAndFeel();
-       if (!lafSet)
-       {
-         Console.error("Could not set requested laf=" + laf);
-       }
-       break;
-     case "system":
-       lafSet = setSystemLookAndFeel();
-       if (!lafSet)
+       // property laf = "crossplatform", "system", "gtk", "metal", "nimbus",
+       // "mac" or "flat"
+       // If not set (or chosen laf fails), use the normal SystemLaF and if on
+       // Mac,
+       // try Quaqua/Vaqua.
+       String lafProp = System.getProperty("laf");
+       String lafSetting = Cache.getDefault("PREFERRED_LAF", null);
+       String laf = "none";
+       if (lafProp != null)
        {
-         Console.error("Could not set requested laf=" + laf);
+         laf = lafProp;
        }
-       break;
-     case "gtk":
-       lafSet = setGtkLookAndFeel();
-       if (!lafSet)
+       else if (lafSetting != null)
        {
-         Console.error("Could not set requested laf=" + laf);
+         laf = lafSetting;
        }
-       break;
-     case "metal":
-       lafSet = setMetalLookAndFeel();
-       if (!lafSet)
-       {
-         Console.error("Could not set requested laf=" + laf);
-       }
-       break;
-     case "nimbus":
-       lafSet = setNimbusLookAndFeel();
-       if (!lafSet)
-       {
-         Console.error("Could not set requested laf=" + laf);
-       }
-       break;
-     case "flat":
-       lafSet = setFlatLookAndFeel();
-       if (!lafSet)
-       {
-         Console.error("Could not set requested laf=" + laf);
-       }
-       break;
-     case "mac":
-       lafSet = setMacLookAndFeel();
-       if (!lafSet)
+       boolean lafSet = false;
+       switch (laf)
        {
-         Console.error("Could not set requested laf=" + laf);
+       case "crossplatform":
+         lafSet = setCrossPlatformLookAndFeel();
+         if (!lafSet)
+         {
+           Console.error("Could not set requested laf=" + laf);
+         }
+         break;
+       case "system":
+         lafSet = setSystemLookAndFeel();
+         if (!lafSet)
+         {
+           Console.error("Could not set requested laf=" + laf);
+         }
+         break;
+       case "gtk":
+         lafSet = setGtkLookAndFeel();
+         if (!lafSet)
+         {
+           Console.error("Could not set requested laf=" + laf);
+         }
+         break;
+       case "metal":
+         lafSet = setMetalLookAndFeel();
+         if (!lafSet)
+         {
+           Console.error("Could not set requested laf=" + laf);
+         }
+         break;
+       case "nimbus":
+         lafSet = setNimbusLookAndFeel();
+         if (!lafSet)
+         {
+           Console.error("Could not set requested laf=" + laf);
+         }
+         break;
+       case "flat":
+         lafSet = setFlatLookAndFeel();
+         if (!lafSet)
+         {
+           Console.error("Could not set requested laf=" + laf);
+         }
+         break;
+       case "mac":
+         lafSet = setMacLookAndFeel();
+         if (!lafSet)
+         {
+           Console.error("Could not set requested laf=" + laf);
+         }
+         break;
+       case "none":
+         break;
+       default:
+         Console.error("Requested laf=" + laf + " not implemented");
        }
-       break;
-     case "none":
-       break;
-     default:
-       Console.error("Requested laf=" + laf + " not implemented");
-     }
-     if (!lafSet)
-     {
-       // Flatlaf default for everyone!
-       lafSet = setFlatLookAndFeel();
        if (!lafSet)
        {
-         setSystemLookAndFeel();
-       }
-       if (Platform.isLinux())
-       {
-         setLinuxLookAndFeel();
-       }
-       if (Platform.isMac())
-       {
-         setMacLookAndFeel();
+         // Flatlaf default for everyone!
+         lafSet = setFlatLookAndFeel();
+         if (!lafSet)
+         {
+           setSystemLookAndFeel();
+         }
+         if (Platform.isLinux())
+         {
+           setLinuxLookAndFeel();
+         }
+         if (Platform.isMac())
+         {
+           setMacLookAndFeel();
+         }
        }
      }
    }
       * start a User Config prompt asking if we can log usage statistics.
       */
      PromptUserConfig prompter = new PromptUserConfig(Desktop.desktop,
 -            "USAGESTATS", "Jalview Usage Statistics",
 -            "Do you want to help make Jalview better by enabling "
 -                    + "the collection of usage statistics with Google Analytics ?"
 -                    + "\n\n(you can enable or disable usage tracking in the preferences)",
 +            "USAGESTATS",
 +            MessageManager.getString("prompt.google_analytics_title"),
 +            MessageManager.getString("prompt.google_analytics"),
              new Runnable()
              {
                @Override