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