From: Ben Soares Date: Fri, 8 Jan 2021 12:02:52 +0000 (+0000) Subject: JAL-3416 Added FlatLightLaf, use with -Dlaf=flat property X-Git-Tag: Release_2_11_2_6~44^2~16 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=aa21fe8615f70113ed752f74b84c15845b585064;hp=-c;p=jalview.git JAL-3416 Added FlatLightLaf, use with -Dlaf=flat property --- aa21fe8615f70113ed752f74b84c15845b585064 diff --git a/j11lib/flatlaf-0.46.jar b/j11lib/flatlaf-0.46.jar new file mode 100644 index 0000000..4f6e06b Binary files /dev/null and b/j11lib/flatlaf-0.46.jar differ diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 4c21624..1afe1d5 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -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",