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