org.tentackle.ui
Class FormEventQueue

java.lang.Object
  extended by java.awt.EventQueue
      extended by org.tentackle.ui.FormEventQueue

public class FormEventQueue
extends EventQueue

A replacement for the standard event queue providing support for dropping key events a given amount of time.

Author:
harald

Field Summary
static long dropKeyEventDefaultTime
          default milliseconds to drop keyevents for FormError, etc...
 
Constructor Summary
FormEventQueue()
          Creates an event queue.
 
Method Summary
 void dropKeyEvents()
          Drops all key events so far up to a given time from now.
 void dropKeyEvents(long millis)
          Drops all key events so far up to a given time from now.
Useful for dialogs to prevent accidently ack (usually ENTER) by user.
 AWTEvent getNextEvent()
          Removes an event from the EventQueue and returns it.
 
Methods inherited from class java.awt.EventQueue
dispatchEvent, getCurrentEvent, getMostRecentEventTime, invokeAndWait, invokeLater, isDispatchThread, peekEvent, peekEvent, pop, postEvent, push
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dropKeyEventDefaultTime

public static long dropKeyEventDefaultTime
default milliseconds to drop keyevents for FormError, etc...

Constructor Detail

FormEventQueue

public FormEventQueue()
Creates an event queue.

Method Detail

dropKeyEvents

public void dropKeyEvents(long millis)
Drops all key events so far up to a given time from now.
Useful for dialogs to prevent accidently ack (usually ENTER) by user.

Parameters:
millis - the time in milliseconds to add the current system time

dropKeyEvents

public void dropKeyEvents()
Drops all key events so far up to a given time from now.

See Also:
dropKeyEventDefaultTime

getNextEvent

public AWTEvent getNextEvent()
                      throws InterruptedException
Removes an event from the EventQueue and returns it. This method will block until an event has been posted by another thread.

Overridden to drop keyboard events.

Overrides:
getNextEvent in class EventQueue
Returns:
the next AWTEvent
Throws:
InterruptedException - if any thread has interrupted this thread


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de