Skip to content

Commit 15a7dc6

Browse files
committed
j2sClazz adds simple new_ options, j2sApplet getFile....
added options for Wei to experiment with direct JavaScript use of Clazz.new_, swingjs.JSUtil.getFileAsBytes$O(name), and J2S.getFileFromDialog(fDone,format)
1 parent 830659f commit 15a7dc6

File tree

7 files changed

+22
-6
lines changed

7 files changed

+22
-6
lines changed
153 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200116173050
1+
20200116195702
153 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200116173050
1+
20200116195702
153 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/srcjs/js/j2sClazz.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,16 @@ Clazz.new_ = function(c, args, cl) {
601601

602602
if (c.__CLASS_NAME__ && c.c$)
603603
c = c.c$;
604-
else if (typeof c == "string")
605-
return Clazz.new_(Clazz.load(c));
604+
else if (typeof c == "string") {
605+
// Clazz.new_("path.className")
606+
// Clazz.new_("path.className","$I$O...",[3,"test"]);
607+
switch(arguments.length) {
608+
case 1:
609+
return Clazz.new_(Clazz.load(c));
610+
case 3:
611+
return Clazz.new_(Clazz.load(c)["c$" + args], cl)
612+
}
613+
}
606614

607615
// an inner class will attach arguments to the arguments returned
608616
// Integer will be passed as is here, without c.exClazz, or cl

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14458,8 +14458,16 @@ Clazz.new_ = function(c, args, cl) {
1445814458

1445914459
if (c.__CLASS_NAME__ && c.c$)
1446014460
c = c.c$;
14461-
else if (typeof c == "string")
14462-
return Clazz.new_(Clazz.load(c));
14461+
else if (typeof c == "string") {
14462+
// Clazz.new_("path.className")
14463+
// Clazz.new_("path.className","$I$O...",[3,"test"]);
14464+
switch(arguments.length) {
14465+
case 1:
14466+
return Clazz.new_(Clazz.load(c));
14467+
case 3:
14468+
return Clazz.new_(Clazz.load(c)["c$" + args], cl)
14469+
}
14470+
}
1446314471

1446414472
// an inner class will attach arguments to the arguments returned
1446514473
// Integer will be passed as is here, without c.exClazz, or cl

0 commit comments

Comments
 (0)