JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / java / awt / event / ActionEvent.js
1 Clazz.declarePackage ("java.awt.event");\r
2 Clazz.load (["java.awt.AWTEvent"], "java.awt.event.ActionEvent", ["java.awt.event.KeyEvent"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.actionCommand = null;\r
5 this.when = 0;\r
6 this.modifiers = 0;\r
7 Clazz.instantialize (this, arguments);\r
8 }, java.awt.event, "ActionEvent", java.awt.AWTEvent);\r
9 Clazz.makeConstructor (c$, \r
10 function (source, id, command) {\r
11 this.construct (source, id, command, 0);\r
12 }, "~O,~N,~S");\r
13 Clazz.makeConstructor (c$, \r
14 function (source, id, command, modifiers) {\r
15 this.construct (source, id, command, 0, modifiers);\r
16 }, "~O,~N,~S,~N");\r
17 Clazz.makeConstructor (c$, \r
18 function (source, id, command, when, modifiers) {\r
19 Clazz.superConstructor (this, java.awt.event.ActionEvent, [source, id]);\r
20 this.actionCommand = command;\r
21 this.when = when;\r
22 this.modifiers = modifiers;\r
23 }, "~O,~N,~S,~N,~N");\r
24 Clazz.defineMethod (c$, "getActionCommand", \r
25 function () {\r
26 return this.actionCommand;\r
27 });\r
28 Clazz.defineMethod (c$, "getWhen", \r
29 function () {\r
30 return this.when;\r
31 });\r
32 Clazz.defineMethod (c$, "getModifiers", \r
33 function () {\r
34 return this.modifiers;\r
35 });\r
36 Clazz.overrideMethod (c$, "paramString", \r
37 function () {\r
38 var typeStr;\r
39 switch (this.id) {\r
40 case 1001:\r
41 typeStr = "ACTION_PERFORMED";\r
42 break;\r
43 default:\r
44 typeStr = "unknown type";\r
45 }\r
46 return typeStr + ",cmd=" + this.actionCommand + ",when=" + this.when + ",modifiers=" + java.awt.event.KeyEvent.getKeyModifiersText (this.modifiers);\r
47 });\r
48 Clazz.defineStatics (c$,\r
49 "SHIFT_MASK", 1,\r
50 "CTRL_MASK", 2,\r
51 "META_MASK", 4,\r
52 "ALT_MASK", 8,\r
53 "ACTION_FIRST", 1001,\r
54 "ACTION_LAST", 1001,\r
55 "ACTION_PERFORMED", 1001);\r
56 });\r