From: Ben Soares Date: Thu, 30 Apr 2020 19:41:09 +0000 (+0100) Subject: JAL-3608 Enforcing MetalLookAndFeel as default on linux. Can be overridden with laf... X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~16^2^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2755a1968acdafb85e37bb88dcc29d7dd98b154c;p=jalview.git JAL-3608 Enforcing MetalLookAndFeel as default on linux. Can be overridden with laf property. --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 87e26ee..cc3a4a2 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -415,6 +415,9 @@ public class Jalview if (!lafSet) { setSystemLookAndFeel(); + if (Platform.isLinux() && ! Platform.isJS()) { + setMetalLookAndFeel(); + } if (Platform.isAMacAndNotJS()) { setMacLookAndFeel(); diff --git a/src/jalview/util/Platform.java b/src/jalview/util/Platform.java index d6627c4..71d798d 100644 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@ -52,7 +52,7 @@ public class Platform false; private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null, - isWin = null; + isWin = null, isLinux = null; private static Boolean isHeadless = null; @@ -81,6 +81,18 @@ public class Platform } /** + * added to check LaF for Linux + * + * @return + */ + public static boolean isLinux() + { + return (isLinux == null + ? (isLinux = (System.getProperty("os.name").indexOf("Linux") >= 0)) + : isLinux); + } + + /** * * @return true if HTML5 JavaScript */