84876c48d8eb918254adbf35a409aa53204f4cce
[jalviewjs.git] / site / swingjs / j2s / jssun / awt / PostEventQueue.js
1 Clazz.declarePackage ("jssun.awt");\r
2 Clazz.load (null, "jssun.awt.PostEventQueue", ["jssun.awt.EventQueueItem", "$.SunToolkit", "swingjs.JSToolkit"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.queueHead = null;\r
5 this.queueTail = null;\r
6 this.eventQueue = null;\r
7 Clazz.instantialize (this, arguments);\r
8 }, jssun.awt, "PostEventQueue");\r
9 Clazz.makeConstructor (c$, \r
10 function (eq) {\r
11 this.eventQueue = eq;\r
12 }, "java.awt.EventQueue");\r
13 Clazz.defineMethod (c$, "noEvents", \r
14 function () {\r
15 return this.queueHead == null;\r
16 });\r
17 Clazz.defineMethod (c$, "flush", \r
18 function () {\r
19 if (this.queueHead != null) {\r
20 var tempQueue;\r
21 {\r
22 tempQueue = this.queueHead;\r
23 this.queueHead = this.queueTail = null;\r
24 while (tempQueue != null) {\r
25 swingjs.JSToolkit.alert ("postevent IS NOT IMPLEMENTED " + tempQueue.event);\r
26 this.eventQueue.postEvent (tempQueue.event);\r
27 tempQueue = tempQueue.next;\r
28 }\r
29 }}});\r
30 Clazz.defineMethod (c$, "postEvent", \r
31 function (event) {\r
32 var item =  new jssun.awt.EventQueueItem (event);\r
33 {\r
34 if (this.queueHead == null) {\r
35 this.queueHead = this.queueTail = item;\r
36 } else {\r
37 this.queueTail.next = item;\r
38 this.queueTail = item;\r
39 }}jssun.awt.SunToolkit.wakeupEventQueue (this.eventQueue, false);\r
40 }, "java.awt.AWTEvent");\r
41 });\r