Package java.awt

Examples of java.awt.EventQueue


  /**
   * 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

* @author Alex Ruiz
*/
public class EventQueueMapping_eventQueues_Test extends EventQueueMapping_TestCase {
  @Test
  public void should_return_all_EventQueues() {
    EventQueue anotherEventQueue = new EventQueue();
    ToolkitStub anotherToolkit = newToolkitStub(anotherEventQueue);
    ComponentWithCustomEventQueue anotherComponent = new ComponentWithCustomEventQueue(anotherToolkit);
    mapping.addQueueFor(component);
    mapping.addQueueFor(anotherComponent);
    Collection<EventQueue> allEventQueues = mapping.eventQueues();
View Full Code Here

TOP

Related Classes of java.awt.EventQueue

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.