ex.printStackTrace(System.err);
}
}
-
+
if (groovyscript != null)
{
// Execute the groovy script after we've done all the rendering stuff
private static void setLookAndFeel()
{
- // property laf = "crossplatform", "system", "gtk", "metal", "nimbus",
- // "mac" or "flat"
- // 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)
+ if (!Platform.isJS())
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
{
- case "crossplatform":
- lafSet = setCrossPlatformLookAndFeel();
- if (!lafSet)
- {
- Console.error("Could not set requested laf=" + laf);
- }
- break;
- case "system":
- lafSet = setSystemLookAndFeel();
- if (!lafSet)
- {
- Console.error("Could not set requested laf=" + laf);
+ // property laf = "crossplatform", "system", "gtk", "metal", "nimbus",
+ // "mac" or "flat"
+ // 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;
}
- break;
- case "gtk":
- lafSet = setGtkLookAndFeel();
- if (!lafSet)
+ else if (lafSetting != null)
{
- Console.error("Could not set requested laf=" + laf);
+ laf = lafSetting;
}
- break;
- case "metal":
- lafSet = setMetalLookAndFeel();
- if (!lafSet)
- {
- Console.error("Could not set requested laf=" + laf);
- }
- break;
- case "nimbus":
- lafSet = setNimbusLookAndFeel();
- if (!lafSet)
- {
- Console.error("Could not set requested laf=" + laf);
- }
- break;
- case "flat":
- lafSet = setFlatLookAndFeel();
- if (!lafSet)
- {
- Console.error("Could not set requested laf=" + laf);
- }
- break;
- case "mac":
- lafSet = setMacLookAndFeel();
- if (!lafSet)
+ boolean lafSet = false;
+ switch (laf)
{
- Console.error("Could not set requested laf=" + laf);
+ case "crossplatform":
+ lafSet = setCrossPlatformLookAndFeel();
+ if (!lafSet)
+ {
+ Console.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "system":
+ lafSet = setSystemLookAndFeel();
+ if (!lafSet)
+ {
+ Console.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "gtk":
+ lafSet = setGtkLookAndFeel();
+ if (!lafSet)
+ {
+ Console.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "metal":
+ lafSet = setMetalLookAndFeel();
+ if (!lafSet)
+ {
+ Console.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "nimbus":
+ lafSet = setNimbusLookAndFeel();
+ if (!lafSet)
+ {
+ Console.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "flat":
+ lafSet = setFlatLookAndFeel();
+ if (!lafSet)
+ {
+ Console.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "mac":
+ lafSet = setMacLookAndFeel();
+ if (!lafSet)
+ {
+ Console.error("Could not set requested laf=" + laf);
+ }
+ break;
+ case "none":
+ break;
+ default:
+ Console.error("Requested laf=" + laf + " not implemented");
}
- break;
- case "none":
- break;
- default:
- Console.error("Requested laf=" + laf + " not implemented");
- }
- if (!lafSet)
- {
- // Flatlaf default for everyone!
- lafSet = setFlatLookAndFeel();
if (!lafSet)
{
- setSystemLookAndFeel();
- }
- if (Platform.isLinux())
- {
- setLinuxLookAndFeel();
- }
- if (Platform.isMac())
- {
- setMacLookAndFeel();
+ // Flatlaf default for everyone!
+ lafSet = setFlatLookAndFeel();
+ if (!lafSet)
+ {
+ setSystemLookAndFeel();
+ }
+ if (Platform.isLinux())
+ {
+ setLinuxLookAndFeel();
+ }
+ if (Platform.isMac())
+ {
+ setMacLookAndFeel();
+ }
}
}
}