From: Ben Soares Date: Fri, 1 May 2020 10:58:13 +0000 (+0100) Subject: JAL-3608 Now reporting the actual LookAndFeel in Java Console X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~16^2^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fd4703aa3d5a598c26d336affca8215e8ea63db7;p=jalview.git JAL-3608 Now reporting the actual LookAndFeel in Java Console --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 788cb02..bba79d1 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -48,6 +48,10 @@ import java.util.Locale; import java.util.Properties; import java.util.StringTokenizer; import java.util.TreeSet; +import java.util.regex.Pattern; + +import javax.swing.LookAndFeel; +import javax.swing.UIManager; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Level; @@ -1155,7 +1159,12 @@ public class Cache System.getProperty("installer_template_version"), "\n", null); appendIfNotNull(sb, "Launcher version: ", System.getProperty("launcher_version"), "\n", null); - if (jalview.bin.Cache.getDefault("VERSION", "TEST").equals("DEVELOPMENT")) { + LookAndFeel laf = UIManager.getLookAndFeel(); + String lafName = laf == null?"Not obtained":laf.getName(); + String lafClass = laf == null?"unknown":laf.getClass().getName(); + appendIfNotNull(sb, "LookAndFeel: ", lafName+" ("+lafClass+")", "\n", null); + // Not displayed in release version ( determined by possible version number regex 9[9.]*9[.-_a9]* ) + if (Pattern.matches("^\\d[\\d\\.]*\\d[\\.\\-\\w]*$", jalview.bin.Cache.getDefault("VERSION", "TEST"))) { appendIfNotNull(sb, "Getdown appdir: ", System.getProperty("getdownappdir"), "\n", null); appendIfNotNull(sb, "Java home: ", System.getProperty("java.home"),