JAL-3608 Now reporting the actual LookAndFeel in Java Console
authorBen Soares <bsoares@dundee.ac.uk>
Fri, 1 May 2020 10:58:13 +0000 (11:58 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Fri, 1 May 2020 10:58:13 +0000 (11:58 +0100)
src/jalview/bin/Cache.java

index 788cb02..bba79d1 100755 (executable)
@@ -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"),