From fd4703aa3d5a598c26d336affca8215e8ea63db7 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 1 May 2020 11:58:13 +0100 Subject: [PATCH] JAL-3608 Now reporting the actual LookAndFeel in Java Console --- src/jalview/bin/Cache.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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"), -- 1.7.10.2