JAL-3416 Added FlatLightLaf, use with -Dlaf=flat property
authorBen Soares <b.soares@dundee.ac.uk>
Fri, 8 Jan 2021 12:02:52 +0000 (12:02 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 8 Jan 2021 12:02:52 +0000 (12:02 +0000)
j11lib/flatlaf-0.46.jar [new file with mode: 0644]
src/jalview/bin/Jalview.java

diff --git a/j11lib/flatlaf-0.46.jar b/j11lib/flatlaf-0.46.jar
new file mode 100644 (file)
index 0000000..4f6e06b
Binary files /dev/null and b/j11lib/flatlaf-0.46.jar differ
index 4c21624..1afe1d5 100755 (executable)
@@ -844,8 +844,8 @@ public class Jalview
 
   private static void setLookAndFeel()
   {
-    // property laf = "crossplatform", "system", "gtk", "metal", "nimbus" or
-    // "mac"
+    // 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");
@@ -897,6 +897,13 @@ public class Jalview
         Cache.log.error("Could not set requested laf=" + laf);
       }
       break;
+    case "flat":
+      lafSet = setFlatLookAndFeel();
+      if (!lafSet)
+      {
+        Cache.log.error("Could not set requested laf=" + laf);
+      }
+      break;
     case "quaqua":
       lafSet = setQuaquaLookAndFeel();
       if (!lafSet)
@@ -981,7 +988,7 @@ public class Jalview
         if (info.getName() != null && nameStartsWith
                 ? info.getName().toLowerCase()
                         .startsWith(name.toLowerCase())
-                : info.getName().toLowerCase().equals(name.toLowerCase()))
+                : info.getName().equalsIgnoreCase(name.toLowerCase()))
         {
           className = info.getClassName();
           break;
@@ -1016,6 +1023,12 @@ public class Jalview
             "javax.swing.plaf.nimbus.NimbusLookAndFeel", false);
   }
 
+  private static boolean setFlatLookAndFeel()
+  {
+    return setSpecificLookAndFeel("flatlaf light",
+            "com.formdev.flatlaf.FlatLightLaf", false);
+  }
+
   private static boolean setQuaquaLookAndFeel()
   {
     return setSpecificLookAndFeel("quaqua",