1 Clazz.declarePackage ("jssun.swing");
\r
2 Clazz.load (["javax.swing.UIDefaults"], "jssun.swing.SwingLazyValue", ["java.lang.Boolean", "java.awt.Color", "javax.swing.plaf.ColorUIResource"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.className = null;
\r
5 this.methodName = null;
\r
7 Clazz.instantialize (this, arguments);
\r
8 }, jssun.swing, "SwingLazyValue", null, javax.swing.UIDefaults.LazyValue);
\r
9 Clazz.makeConstructor (c$,
\r
11 this.construct (c, Clazz.castNullAs ("String"));
\r
13 Clazz.makeConstructor (c$,
\r
15 this.construct (c, m, null);
\r
17 Clazz.makeConstructor (c$,
\r
19 this.construct (c, null, o);
\r
21 Clazz.makeConstructor (c$,
\r
22 function (c, m, o) {
\r
24 this.methodName = m;
\r
26 this.args = o.clone ();
\r
28 Clazz.overrideMethod (c$, "createValue",
\r
31 var c = Clazz._4Name (this.className, true, null);
\r
32 if (this.methodName != null) {
\r
33 var types = this.getClassArray (this.args);
\r
34 var m = c.getMethod (this.methodName, types);
\r
35 return m.invoke (c, this.args);
\r
37 var types = this.getClassArray (this.args);
\r
38 var constructor = c.getConstructor (types);
\r
39 return constructor.newInstance (this.args);
\r
41 if (Clazz.exceptionOf (e, Exception)) {
\r
47 }, "javax.swing.UIDefaults");
\r
48 Clazz.defineMethod (c$, "getClassArray",
\r
52 types = new Array (args.length);
\r
53 for (var i = 0; i < args.length; i++) {
\r
54 if (Clazz.instanceOf (args[i], Integer)) {
\r
55 types[i] = Integer.TYPE;
\r
56 } else if (Clazz.instanceOf (args[i], Boolean)) {
\r
57 types[i] = Boolean.TYPE;
\r
58 } else if (Clazz.instanceOf (args[i], javax.swing.plaf.ColorUIResource)) {
\r
59 types[i] = java.awt.Color;
\r
61 types[i] = args[i].getClass ();
\r