Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / swingjs / j2s / swingjs / test / BugTest.js
index 29528f3..261b8a6 100644 (file)
-Clazz.declarePackage ("swingjs.test");\r
-Clazz.load (["java.util.HashMap"], ["swingjs.test.BugTest", "$.A", "$.B"], null, function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.me = "me";\r
-this.name = null;\r
-Clazz.instantialize (this, arguments);\r
-}, swingjs.test, "BugTest", java.util.HashMap);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, swingjs.test.BugTest, []);\r
-System.out.println ("this is BugTest()" + this.me);\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (s) {\r
-Clazz.superConstructor (this, swingjs.test.BugTest, []);\r
-System.out.println ("this is BugTest(String):" + s + this.me);\r
-}, "~S");\r
-Clazz.makeConstructor (c$, \r
-function (o) {\r
-Clazz.superConstructor (this, swingjs.test.BugTest, []);\r
-System.out.println ("this is BugTest(Object[]):" + o + this.me);\r
-}, "~A");\r
-Clazz.makeConstructor (c$, \r
-function (s, t) {\r
-Clazz.superConstructor (this, swingjs.test.BugTest, []);\r
-System.out.println ("this is BugTest(String,String):" + s + t + this.me);\r
-}, "~S,~S");\r
-Clazz.defineMethod (c$, "test", \r
- function (a) {\r
-System.out.println (a + " is an AbstractMap");\r
-}, "java.util.AbstractMap");\r
-Clazz.defineMethod (c$, "test", \r
- function (ja) {\r
-System.out.println (ja + " is an Object");\r
-}, "~O");\r
-Clazz.defineMethod (c$, "test1", \r
- function (ja) {\r
-System.out.println (ja + " is a Number");\r
-}, "Number");\r
-Clazz.defineMethod (c$, "test1", \r
- function (ja) {\r
-System.out.println (ja + " is an int");\r
-}, "~N");\r
-c$.getFont = Clazz.defineMethod (c$, "getFont", \r
- function (f) {\r
-return f;\r
-}, "~S");\r
-c$.getFont = Clazz.defineMethod (c$, "getFont", \r
- function (f, y) {\r
-return f + y;\r
-}, "~S,~S");\r
-c$.main = Clazz.defineMethod (c$, "main", \r
-function (args) {\r
- new swingjs.test.B ().init ();\r
-try {\r
-var cl;\r
-cl = Clazz._4Name ("swingjs.test.BugTest");\r
-cl.getConstructor ([String, String]).newInstance ( Clazz.newArray (-1, ["test1", "test2"]));\r
-cl.getConstructor ([Array]).newInstance ( Clazz.newArray (-1, [ Clazz.newArray (-1, ["test1", "test2"])]));\r
-cl.getConstructor ([String, String]).newInstance (["test1", "test2"]);\r
-cl.getConstructor ([]).newInstance ([]);\r
-cl.newInstance ();\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, Exception)) {\r
-e.printStackTrace ();\r
-} else {\r
-throw e;\r
-}\r
-}\r
-System.out.println (swingjs.test.BugTest.getFont ("f"));\r
-System.out.println (swingjs.test.BugTest.getFont ("f", "y"));\r
-var t =  new swingjs.test.BugTest ();\r
-t.name = "test";\r
-t.test1 (Integer.$valueOf (33));\r
-t.test1 (33);\r
-t.test (t);\r
-t.test (t);\r
-var a2 =  Clazz.newIntArray (2, 0);\r
-var a20 =  Clazz.newIntArray (2, 0);\r
-var a23 =  Clazz.newIntArray (2, 3, 0);\r
-swingjs.test.BugTest.printit ([2, 3, 4, 5]);\r
-System.out.println (args);\r
-var test =  Clazz.newCharArray (-1, ['1', '2', '3', '4', '5']);\r
-var s =  String.instantialize (test, 2, 3);\r
-System.out.println ("char test: 345 = " + s);\r
-}, "~A");\r
-c$.printit = Clazz.defineMethod (c$, "printit", \r
-function (t) {\r
-for (var i = 0; i < t.length; i++) System.out.println (t[i]);\r
-\r
-}, "~A");\r
-c$ = Clazz.declareType (swingjs.test, "A");\r
-Clazz.defineMethod (c$, "init", \r
- function () {\r
-System.out.println ("class A init");\r
-});\r
-Clazz.defineMethod (c$, "init", \r
-function (a) {\r
-System.out.println ("class A init String a");\r
-}, "~S");\r
-Clazz.defineMethod (c$, "init2", \r
-function () {\r
-System.out.println ("class A init2");\r
-this.init ();\r
-});\r
-c$ = Clazz.declareType (swingjs.test, "B", swingjs.test.A);\r
-Clazz.defineMethod (c$, "init", \r
-function () {\r
-var $private = Clazz.checkPrivateMethod (arguments);\r
-if ($private != null) {\r
-return $private.apply (this, arguments);\r
-}\r
-System.out.println ("class B init");\r
-Clazz.superCall (this, swingjs.test.B, "init2", []);\r
-});\r
-Clazz.defineMethod (c$, "init", \r
-function (b) {\r
-var $private = Clazz.checkPrivateMethod (arguments);\r
-if ($private != null) {\r
-return $private.apply (this, arguments);\r
-}\r
-System.out.println ("class B init String b");\r
-}, "~S");\r
-});\r
+Clazz.declarePackage ("swingjs.test");
+Clazz.load (["java.util.HashMap"], ["swingjs.test.BugTest", "$.A", "$.B"], null, function () {
+c$ = Clazz.decorateAsClass (function () {
+this.me = "me";
+this.name = null;
+Clazz.instantialize (this, arguments);
+}, swingjs.test, "BugTest", java.util.HashMap);
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, swingjs.test.BugTest, []);
+System.out.println ("this is BugTest()" + this.me);
+});
+Clazz.makeConstructor (c$, 
+function (s) {
+Clazz.superConstructor (this, swingjs.test.BugTest, []);
+System.out.println ("this is BugTest(String):" + s + this.me);
+}, "~S");
+Clazz.makeConstructor (c$, 
+function (o) {
+Clazz.superConstructor (this, swingjs.test.BugTest, []);
+System.out.println ("this is BugTest(Object[]):" + o + this.me);
+}, "~A");
+Clazz.makeConstructor (c$, 
+function (s, t) {
+Clazz.superConstructor (this, swingjs.test.BugTest, []);
+System.out.println ("this is BugTest(String,String):" + s + t + this.me);
+}, "~S,~S");
+Clazz.defineMethod (c$, "test", 
+ function (a) {
+System.out.println (a + " is an AbstractMap");
+}, "java.util.AbstractMap");
+Clazz.defineMethod (c$, "test", 
+ function (ja) {
+System.out.println (ja + " is an Object");
+}, "~O");
+Clazz.defineMethod (c$, "test1", 
+ function (ja) {
+System.out.println (ja + " is a Number");
+}, "Number");
+Clazz.defineMethod (c$, "test1", 
+ function (ja) {
+System.out.println (ja + " is an int");
+}, "~N");
+c$.getFont = Clazz.defineMethod (c$, "getFont", 
+ function (f) {
+return f;
+}, "~S");
+c$.getFont = Clazz.defineMethod (c$, "getFont", 
+ function (f, y) {
+return f + y;
+}, "~S,~S");
+c$.main = Clazz.defineMethod (c$, "main", 
+function (args) {
+ new swingjs.test.B ().init ();
+try {
+var cl;
+cl = Clazz._4Name ("swingjs.test.BugTest");
+cl.getConstructor ([String, String]).newInstance ( Clazz.newArray (-1, ["test1", "test2"]));
+cl.getConstructor ([Array]).newInstance ( Clazz.newArray (-1, [ Clazz.newArray (-1, ["test1", "test2"])]));
+cl.getConstructor ([String, String]).newInstance (["test1", "test2"]);
+cl.getConstructor ([]).newInstance ([]);
+cl.newInstance ();
+} catch (e) {
+if (Clazz.exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+System.out.println (swingjs.test.BugTest.getFont ("f"));
+System.out.println (swingjs.test.BugTest.getFont ("f", "y"));
+var t =  new swingjs.test.BugTest ();
+t.name = "test";
+t.test1 (Integer.$valueOf (33));
+t.test1 (33);
+t.test (t);
+t.test (t);
+var a2 =  Clazz.newIntArray (2, 0);
+var a20 =  Clazz.newIntArray (2, 0);
+var a23 =  Clazz.newIntArray (2, 3, 0);
+swingjs.test.BugTest.printit ([2, 3, 4, 5]);
+System.out.println (args);
+var test =  Clazz.newCharArray (-1, ['1', '2', '3', '4', '5']);
+var s =  String.instantialize (test, 2, 3);
+System.out.println ("char test: 345 = " + s);
+}, "~A");
+c$.printit = Clazz.defineMethod (c$, "printit", 
+function (t) {
+for (var i = 0; i < t.length; i++) System.out.println (t[i]);
+
+}, "~A");
+c$ = Clazz.declareType (swingjs.test, "A");
+Clazz.defineMethod (c$, "init", 
+ function () {
+System.out.println ("class A init");
+});
+Clazz.defineMethod (c$, "init", 
+function (a) {
+System.out.println ("class A init String a");
+}, "~S");
+Clazz.defineMethod (c$, "init2", 
+function () {
+System.out.println ("class A init2");
+this.init ();
+});
+c$ = Clazz.declareType (swingjs.test, "B", swingjs.test.A);
+Clazz.defineMethod (c$, "init", 
+function () {
+var $private = Clazz.checkPrivateMethod (arguments);
+if ($private != null) {
+return $private.apply (this, arguments);
+}
+System.out.println ("class B init");
+Clazz.superCall (this, swingjs.test.B, "init2", []);
+});
+Clazz.defineMethod (c$, "init", 
+function (b) {
+var $private = Clazz.checkPrivateMethod (arguments);
+if ($private != null) {
+return $private.apply (this, arguments);
+}
+System.out.println ("class B init String b");
+}, "~S");
+});