public static String getVersionDetailsForConsole()
{
StringBuilder sb = new StringBuilder();
- sb.append("Jalview Version: "
- + jalview.bin.Cache.getDefault("VERSION", "TEST"));
+ sb.append("Jalview Version: ");
+ sb.append(jalview.bin.Cache.getDefault("VERSION", "TEST"));
sb.append("\n");
- sb.append("Jalview Installation: "
- + jalview.bin.Cache.getDefault("INSTALLATION", "unknown"));
+ sb.append("Jalview Installation: ");
+ sb.append(jalview.bin.Cache.getDefault("INSTALLATION", "unknown"));
sb.append("\n");
- sb.append("Build Date: "
- + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
+ sb.append("Build Date: ");
+ sb.append(jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
sb.append("\n");
- sb.append("Java version: " + System.getProperty("java.version"));
+ sb.append("Java version: ");
+ sb.append(System.getProperty("java.version"));
sb.append("\n");
- sb.append(System.getProperty("os.arch") + " "
- + System.getProperty("os.name") + " "
- + System.getProperty("os.version"));
+ sb.append(System.getProperty("os.arch"));
+ sb.append(" ");
+ sb.append(System.getProperty("os.name"));
+ sb.append(" ");
+ sb.append(System.getProperty("os.version"));
sb.append("\n");
appendIfNotNull(sb, "Install4j version: ",
System.getProperty("sys.install4jVersion"), "\n", null);
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);
+ sb.append("LookAndFeel: ");
+ sb.append(lafName);
+ sb.append(" (");
+ sb.append(lafClass);
+ sb.append(")\n");
// Not displayed in release version ( determined by possible version number
// regex 9[9.]*9[.-_a9]* )
if (Pattern.matches("^\\d[\\d\\.]*\\d[\\.\\-\\w]*$",
desktop = null;
- // property laf = "crossplatform", "system", "gtk", "metal", "nimbus" or
- // "mac"
- // If not set (or chosen laf fails), use the normal SystemLaF and if on Mac,
- // try Quaqua/Vaqua.
- String lafProp = System.getProperty("laf");
- String lafSetting = Cache.getDefault("PREFERRED_LAF", null);
- String laf = "none";
- if (lafProp != null)
- {
- laf = lafProp;
- }
- else if (lafSetting != null)
- {
- laf = lafSetting;
- }
- boolean lafSet = false;
- switch (laf)
- {
- case "crossplatform":
- lafSet = setCrossPlatformLookAndFeel();
- if (!lafSet)
- {
- Cache.log.error("Could not set requested laf=" + laf);
- }
- break;
- case "system":
- lafSet = setSystemLookAndFeel();
- if (!lafSet)
- {
- Cache.log.error("Could not set requested laf=" + laf);
- }
- break;
- case "gtk":
- lafSet = setGtkLookAndFeel();
- {
- Cache.log.error("Could not set requested laf=" + laf);
- }
- break;
- case "metal":
- lafSet = setMetalLookAndFeel();
- {
- Cache.log.error("Could not set requested laf=" + laf);
- }
- break;
- case "nimbus":
- lafSet = setNimbusLookAndFeel();
- {
- Cache.log.error("Could not set requested laf=" + laf);
- }
- break;
- case "quaqua":
- lafSet = setQuaquaLookAndFeel();
- {
- Cache.log.error("Could not set requested laf=" + laf);
- }
- break;
- case "vaqua":
- lafSet = setVaquaLookAndFeel();
- {
- Cache.log.error("Could not set requested laf=" + laf);
- }
- break;
- case "mac":
- lafSet = setMacLookAndFeel();
- if (!lafSet)
- {
- Cache.log.error("Could not set requested laf=" + laf);
- }
- break;
- case "none":
- break;
- default:
- Cache.log.error("Requested laf=" + laf + " not implemented");
- }
- if (!lafSet)
- {
- setSystemLookAndFeel();
- if (Platform.isLinux())
- {
- setMetalLookAndFeel();
- }
- if (Platform.isAMac())
- {
- setMacLookAndFeel();
- }
- }
+ setLookAndFeel();
/*
* configure 'full' SO model if preferences say to, else use the default (SO
}
}
+ private static void setLookAndFeel()
+ {
+ // property laf = "crossplatform", "system", "gtk", "metal", "nimbus" or
+ // "mac"
+ // If not set (or chosen laf fails), use the normal SystemLaF and if on Mac,
+ // try Quaqua/Vaqua.
+ String lafProp = System.getProperty("laf");
+ String lafSetting = Cache.getDefault("PREFERRED_LAF", null);
+ String laf = "none";
+ if (lafProp != null)
+ {
+ laf = lafProp;
+ }
+ else if (lafSetting != null)
+ {
+ laf = lafSetting;
+ }
+ boolean lafSet = false;
+ switch (laf)
+ {
+ case "crossplatform":
+ lafSet = setCrossPlatformLookAndFeel();
+ if (!lafSet)
+ {
+ Cache.log.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "system":
+ lafSet = setSystemLookAndFeel();
+ if (!lafSet)
+ {
+ Cache.log.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "gtk":
+ lafSet = setGtkLookAndFeel();
+ if (!lafSet)
+ {
+ Cache.log.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "metal":
+ lafSet = setMetalLookAndFeel();
+ if (!lafSet)
+ {
+ Cache.log.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "nimbus":
+ lafSet = setNimbusLookAndFeel();
+ if (!lafSet)
+ {
+ Cache.log.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "quaqua":
+ lafSet = setQuaquaLookAndFeel();
+ if (!lafSet)
+ {
+ Cache.log.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "vaqua":
+ lafSet = setVaquaLookAndFeel();
+ if (!lafSet)
+ {
+ Cache.log.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "mac":
+ lafSet = setMacLookAndFeel();
+ if (!lafSet)
+ {
+ Cache.log.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "none":
+ break;
+ default:
+ Cache.log.error("Requested laf=" + laf + " not implemented");
+ }
+ if (!lafSet)
+ {
+ setSystemLookAndFeel();
+ if (Platform.isLinux())
+ {
+ setMetalLookAndFeel();
+ }
+ if (Platform.isAMac())
+ {
+ setMacLookAndFeel();
+ }
+ }
+ }
+
private static boolean setCrossPlatformLookAndFeel()
{
boolean set = false;
} catch (Exception ex)
{
Cache.log.error("Unexpected Look and Feel Exception");
+ Cache.log.error(ex.getMessage());
Cache.log.debug(Cache.getStackTraceString(ex));
}
return set;
} catch (Exception ex)
{
Cache.log.error("Unexpected Look and Feel Exception");
+ Cache.log.error(ex.getMessage());
Cache.log.debug(Cache.getStackTraceString(ex));
}
return set;
} catch (Exception ex)
{
Cache.log.error("Unexpected Look and Feel Exception");
+ Cache.log.error(ex.getMessage());
Cache.log.debug(Cache.getStackTraceString(ex));
}
return set;