Package java.awt

Examples of java.awt.Window


    int eventId = windowEvent.getID();
    if (eventId == WINDOW_CLOSING) {
      return false;
    }
    if (eventId == WINDOW_CLOSED) {
      Window w = windowEvent.getWindow();
      if (disposedWindows.containsKey(w)) {
        return true;
      }
      disposedWindows.put(w, true);
      // execute(addComponentListenerTask(w, new DisposalMonitor(disposedWindows)));
      w.addComponentListener(new DisposalMonitor(disposedWindows));
      return false;
    }
    disposedWindows.remove(windowEvent.getWindow());
    return false;
  }
View Full Code Here


    ToolBarUI ui = toolBar.getUI();
    if (ui instanceof BasicToolBarUI) {
      return ((BasicToolBarUI) ui).isFloating();
    }
    // Have to guess; probably ought to check for sibling components
    Window w = getWindowAncestor(toolBar);
    return !(w instanceof Frame) && toolBar.getParent().getComponentCount() == 1;
  }
View Full Code Here

    });
  }

  @RunsInEDT
  public void should_float_JToolbar() {
    Window oldAncestor = toolBarAncestor();
    driver.makeFloat(toolBar);
    Window newAncestor = toolBarAncestor();
    assertThat(newAncestor).isNotSameAs(oldAncestor);
  }
View Full Code Here

    }
    return !(c instanceof Window) && isWindowIgnored(c);
  }

  private boolean isWindowIgnored(@Nullable Component c) {
    Window w = parentFinder.windowFor(c);
    return w != null && isIgnored(w);
  }
View Full Code Here

  @RunsInEDT
  @Override
  public void eventDispatched(AWTEvent event) {
    AWTEvent e = checkNotNull(event);
    if (wasWindowOpened(e) || wasWindowShown(e)) {
      Window w = sourceOf(e);
      if (w != null) {
        filter(w);
      }
      return;
    }
    if (wasWindowClosed(e)) {
      Window w = sourceOf(e);
      if (w == null) {
        return;
      }
      // *Any* window disposal should result in the window being ignored, at least until it is again displayed.
      if (filter.isIgnored(w)) {
View Full Code Here

  }

  @RunsInEDT
  @Override
  public void windowClosed(WindowEvent e) {
    Window w = e.getWindow();
    w.removeComponentListener(this);
    w.removeWindowListener(this);
  }
View Full Code Here

    Object source = e.getSource();
    if (!(source instanceof Component)) {
      return;
    }
    Component c = (Component) source;
    Window w = c instanceof Window ? (Window) c : getWindowAncestor(c);
    windows.markAsReady(w);
  }
View Full Code Here

    frame.destroy();
  }

  @Test
  public void should_find_Window_ancestor() {
    Window ancestor = WindowAncestorFinder.windowAncestorOf(frame.button);
    assertThat(ancestor).isSameAs(frame);
  }
View Full Code Here

    assertThat(ancestor).isSameAs(frame);
  }

  @Test
  public void should_return_null_if_Component_is_null() {
    Window ancestor = WindowAncestorFinder.windowAncestorOf(null);
    assertThat(ancestor).isSameAs(null);
  }
View Full Code Here

    assertThat(ancestor).isSameAs(null);
  }

  @Test
  public void should_return_Window_as_its_own_ancestor() {
    Window ancestor = WindowAncestorFinder.windowAncestorOf(frame);
    assertThat(ancestor).isSameAs(frame);
  }
View Full Code Here

TOP

Related Classes of java.awt.Window

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.