FileDocCategorySizeDatePackage
NativeEventQueue.javaAPI DocAndroid 1.5 API3403Wed May 06 22:41:54 BST 2009org.apache.harmony.awt.wtk

NativeEventQueue

public abstract class NativeEventQueue extends Object
Describes the cross-platform native event queue interface

The implementation constructor should remember thread it was created. All other methods would be called obly from this thread, except awake().

Fields Summary
private ShutdownWatchdog
shutdownWatchdog
private final Object
eventMonitor
private final LinkedList
eventQueue
Constructors Summary
Methods Summary
protected voidaddEvent(NativeEvent event)

        synchronized (eventQueue) {
            eventQueue.add(event);
            shutdownWatchdog.setNativeQueueEmpty(false);
        }
        synchronized (eventMonitor) {
            eventMonitor.notify();
        }
    
public abstract voidawake()

public abstract voiddispatchEvent()
Add NativeEvent to the queue

public final java.lang.ObjectgetEventMonitor()

        return eventMonitor;
    
public abstract longgetJavaWindow()
Gets AWT system window ID.

return
AWT system window ID

public NativeEventgetNextEvent()

        synchronized (eventQueue) {
            if (eventQueue.isEmpty()) {
                shutdownWatchdog.setNativeQueueEmpty(true);
                return null;
            }
            return eventQueue.remove(0);
        }
    
public booleanisEmpty()
Determines whether or not the native event queue is empty. An queue is empty if it contains no messages waiting.

return
true if the queue is empty; false otherwise


           
    
    
                                            
       

                                      
       
        synchronized(eventQueue) {
            return eventQueue.isEmpty();
        }
    
public abstract voidperformLater(org.apache.harmony.awt.wtk.NativeEventQueue$Task task)

public abstract voidperformTask(org.apache.harmony.awt.wtk.NativeEventQueue$Task task)

public final voidsetShutdownWatchdog(ShutdownWatchdog watchdog)

        synchronized (eventQueue) {
            shutdownWatchdog = watchdog;
        }
    
public abstract booleanwaitEvent()
Blocks current thread until native event queue is not empty or awaken from other thread by awake().

Should be called only on tread which will process native events.

return
if event loop should be stopped