From 2755a1968acdafb85e37bb88dcc29d7dd98b154c Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 30 Apr 2020 20:41:09 +0100 Subject: [PATCH 1/1] JAL-3608 Enforcing MetalLookAndFeel as default on linux. Can be overridden with laf property. --- src/jalview/bin/Jalview.java | 3 +++ src/jalview/util/Platform.java | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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 */ -- 1.7.10.2