Package java.awt.event

Examples of java.awt.event.WindowEvent


    assertThat(monitor.disposedWindows).isEmpty();
  }

  @Test
  public void should_return_is_not_duplicate_if_Window_is_closing() {
    WindowEvent e = new WindowEvent(window, WINDOW_CLOSING);
    assertThat(monitor.isDuplicateDispose(e)).isFalse();
    assertThat(monitor.disposedWindows).isEmpty();
  }
View Full Code Here


  }

  @Test
  public void should_return_is_not_duplicate_if_Window_is_not_closing_and_it_is_not_closed() {
    monitor.disposedWindows.put(window, true);
    WindowEvent e = new WindowEvent(window, WINDOW_OPENED);
    assertThat(monitor.isDuplicateDispose(e)).isFalse();
    assertThat(monitor.disposedWindows).isEmpty();
  }
View Full Code Here

  }

  @Test
  public void should_return_is_duplicate_if_Window_is_closed_and_it_is_marked_as_disposed() {
    monitor.disposedWindows.put(window, true);
    WindowEvent e = new WindowEvent(window, WINDOW_CLOSED);
    assertThat(monitor.isDuplicateDispose(e)).isTrue();
    assertThat(monitor.disposedWindows).hasSize(1);
    assertThat(monitor.disposedWindows).includes(entry(window, true));
  }
View Full Code Here

    assertThat(monitor.disposedWindows).includes(entry(window, true));
  }

  @Test
  public void should_return_is_not_duplicate_if_Window_is_closed_and_it_is_not_marked_as_disposed() {
    WindowEvent e = new WindowEvent(window, WINDOW_CLOSED);
    assertThat(monitor.isDuplicateDispose(e)).isFalse();
    assertThat(monitor.disposedWindows).hasSize(1).includes(entry(window, true));
    ComponentListener[] componentListeners = window.getComponentListeners();
    assertThat(componentListeners).hasSize(1);
    assertThat(componentListeners[0]).isInstanceOf(DisposalMonitor.class);
View Full Code Here

    source.destroy();
  }

  @Test
  public void should_return_true_if_Window_opened() {
    AWTEvent event = new WindowEvent(source, WINDOW_OPENED);
    assertThat(AWTEvents.wasWindowOpened(event)).isTrue();
  }
View Full Code Here

    assertThat(AWTEvents.wasWindowOpened(event)).isTrue();
  }

  @Test
  public void should_return_false_if_Window_not_opened() {
    AWTEvent event = new WindowEvent(source, WINDOW_CLOSING);
    assertThat(AWTEvents.wasWindowOpened(event)).isFalse();
  }
View Full Code Here

*/
public class WindowVisibilityMonitor_windowClosed_Test extends WindowVisibilityMonitor_TestCase {
  @Test
  public void should_remove_itself_when_Window_is_closed() {
    window.startRecording();
    monitor.windowClosed(new WindowEvent(window, 8));
    assertThat(window.requireInvoked("removeWindowListener", args(monitor)));
    assertThat(window.requireInvoked("removeComponentListener", args(monitor)));
    verifyZeroInteractions(windows);
  }
View Full Code Here

  /** {@inheritDoc} */
  @RunsInEDT
  @Override
  public void close(@Nonnull Window w) {
    WindowEvent event = new WindowEvent(w, WINDOW_CLOSING);
    // If the window contains an applet, send the event on the applet's queue instead to ensure a shutdown from the
    // applet's context (assists AppletViewer cleanup).
    Component applet = findAppletDescendent(w);
    EventQueue eventQueue = windowMonitor.eventQueueFor(applet != null ? applet : w);
    checkNotNull(eventQueue).postEvent(event);
View Full Code Here

public class TransientWindowListener_eventDispatched_Test extends TransientWindowListener_eventDispatched_TestCase {
  private WindowEvent event;

  @Override
  void onSetUp() {
    event = new WindowEvent(eventSource, WINDOW_CLOSED);
  }
View Full Code Here

    listener.eventDispatched(event());
    verify(windowFilter).ignore(eventSource);
  }

  private AWTEvent event() {
    return eventId == WINDOW_OPENED ? new WindowEvent(eventSource, eventId) : new ComponentEvent(eventSource, eventId);
  }
View Full Code Here

TOP

Related Classes of java.awt.event.WindowEvent

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.