Package java.awt

Examples of java.awt.EventQueue$Queue


public class QueueTest
{
   public static void main( String args[] )
   {
      Queue queue = new Queue()

      // use enqueue method
      queue.enqueue( -1 );
      queue.print();
      queue.enqueue( 0 );
      queue.print();
      queue.enqueue( 1 );
      queue.print();
      queue.enqueue( 5 );
      queue.print();

      // remove objects from queue
      try
      {
         Object removedObject = null;

         while ( true )
         {
            removedObject = queue.dequeue(); // use dequeue method
            System.out.printf( "%s dequeued\n", removedObject );
            queue.print();
         } // end while
      } // end try
      catch ( EmptyListException emptyListException )
      {
         emptyListException.printStackTrace();
View Full Code Here


  /**
   * Initialize the event queue
   */
  public static void initializeEventQueue() {
    EventQueue waitQueue = new WaitCursorEventQueue(500);
    Toolkit.getDefaultToolkit().getSystemEventQueue().push(waitQueue);
  }
View Full Code Here

* @author Alex Ruiz
*/
public class WindowMonitor_eventQueueFor_Test extends WindowMonitor_TestCase {
  @Test
  public void should_return_EventQueue_for_Component() {
    EventQueue queue = new EventQueue();
    when(context.eventQueueFor(frame)).thenReturn(queue);
    assertThat(monitor.eventQueueFor(frame)).isSameAs(queue);
  }
View Full Code Here

public class ToolkitStub extends Toolkit {
  private Map<AWTEventListener, Long> eventListeners;
  private EventQueue eventQueue;

  static ToolkitStub createNew() {
    return createNew(new EventQueue());
  }
View Full Code Here

  TestWindow window;
  Context context;

  @Before
  public final void setUp() {
    eventQueue = new EventQueue();
    toolkit = newToolkitStub(eventQueue);
    window = TestWindow.createNewWindow(getClass());
    windowEventQueueMapping = mock(WindowEventQueueMapping.class);
    eventQueueMapping = mock(EventQueueMapping.class);
    createContext();
View Full Code Here

    assertThat(windowMapping).isEmpty();
  }

  @Test
  public void should_remove_Component_from_all_mappings() {
    EventQueue anotherEventQueue = new EventQueue();
    Map<Window, Boolean> windowMapping = newHashMap();
    windowMapping.put(window, true);
    queueMap.put(anotherEventQueue, windowMapping);
    mapping.removeMappingFor(window);
    assertThat(windowMapping).isEmpty();
View Full Code Here

*/
public class EventQueueMapping_queueFor_Test extends EventQueueMapping_TestCase {
  @Test
  public void should_return_EventQueue() {
    mapping.addQueueFor(component);
    EventQueue storedEventQueue = mapping.queueFor(component);
    assertThat(storedEventQueue).isSameAs(eventQueue);
  }
View Full Code Here

  }

  @Test
  public void should_return_EventQueue_in_Component_if_no_mapping_found() {
    assertThat(queueMap.keySet()).excludes(eventQueue);
    EventQueue storedEventQueue = mapping.queueFor(component);
    assertThat(storedEventQueue).isSameAs(eventQueue);
  }
View Full Code Here

*/
public class Context_storedQueueFor_Test extends Context_TestCase {
  @Test
  public void should_return_stored_queue() {
    when(eventQueueMapping.storedQueueFor(window)).thenReturn(eventQueue);
    EventQueue storedQueue = context.storedQueueFor(window);
    assertThat(storedQueue).isSameAs(eventQueue);
  }
View Full Code Here

* @author Alex Ruiz
*/
public class WindowEventQueueMapping_eventQueues_Test extends WindowEventQueueMapping_withWindow_TestCase {
  @Test
  public void should_return_EventQueues() {
    EventQueue anotherEventQueue = new EventQueue();
    ToolkitStub anotherToolkit = newToolkitStub(anotherEventQueue);
    MyWindow anotherWindow = MyWindow.createNew(anotherToolkit, getClass());
    mapping.addQueueFor(window);
    mapping.addQueueFor(anotherWindow);
    Collection<EventQueue> eventQueues = mapping.eventQueues();
View Full Code Here

TOP

Related Classes of java.awt.EventQueue$Queue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.