- // property laf = "crossplatform", "system", "gtk", "metal" 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)
- {
- System.err.println("Could not set requested laf=" + laf);
- }
- break;
- case "system":
- lafSet = setSystemLookAndFeel();
- if (!lafSet)
- {
- System.err.println("Could not set requested laf=" + laf);
- }
- break;
- case "gtk":
- lafSet = setGtkLookAndFeel();
- {
- System.err.println("Could not set requested laf=" + laf);
- }
- break;
- case "metal":
- lafSet = setMetalLookAndFeel();
- {
- System.err.println("Could not set requested laf=" + laf);
- }
- break;
- case "nimbus":
- lafSet = setNimbusLookAndFeel();
- {
- System.err.println("Could not set requested laf=" + laf);
- }
- break;
- case "quaqua":
- lafSet = setQuaquaLookAndFeel();
- {
- System.err.println("Could not set requested laf=" + laf);
- }
- break;
- case "vaqua":
- lafSet = setVaquaLookAndFeel();
- {
- System.err.println("Could not set requested laf=" + laf);
- }
- break;
- case "mac":
- lafSet = setMacLookAndFeel();
- if (!lafSet)
- {
- System.err.println("Could not set requested laf=" + laf);
- }
- break;
- case "none":
- break;
- default:
- System.err.println("Requested laf=" + laf + " not implemented");
- }
- if (!lafSet)
- {
- setSystemLookAndFeel();
- if (Platform.isLinux() && !Platform.isJS())
- {
- setMetalLookAndFeel();
- }
- if (Platform.isAMacAndNotJS())
- {
- setMacLookAndFeel();
- }
- }