コード例 #1
0
  void test3(Window owner, Window child1, Window child2) {
    System.out.println("* * * STAGE 3 * * *\nWidow owner: " + owner);

    owner.setFocusableWindowState(true);
    owner.setVisible(true);

    child1.setFocusableWindowState(false);
    child1.setVisible(true);

    child2.setFocusableWindowState(true);
    child2.add(button);
    child2.setVisible(true);

    Util.waitTillShown(child2);

    Util.clickOnComp(button, robot);
    System.err.println(
        "focus owner: " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
    if (button != KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
      throw new RuntimeException("Test failed.");
    }
    child1.dispose();
    child2.dispose();
    owner.dispose();
  }
コード例 #2
0
 @Override
 public void actionPerformed(ActionEvent e) {
   actionPerformedUpdates(_parent);
   _imgBtn.getWindow().close();
   _parent.dispose();
   SikuliIDE.getInstance().getCurrentCodePane().setDirty(setDirty(false));
 }
コード例 #3
0
 private void disposeAndUpdate(boolean update) {
   if (myView != null) {
     boolean visible = myView.isVisible();
     myView.setVisible(false);
     Container container = myContent.getParent();
     if (container != null) {
       container.remove(myContent);
     }
     if (myView instanceof Window) {
       myViewBounds = myView.getBounds();
       Window window = (Window) myView;
       if (!push(UIUtil.getWindow(myOwner), window)) {
         window.dispose();
       }
     } else {
       Container parent = myView.getParent();
       if (parent == null) {
         myViewBounds = new Rectangle(myContent.getPreferredSize());
       } else {
         myViewBounds = new Rectangle(myView.getBounds());
         parent.remove(myView);
         Point point = new Point(myViewBounds.x, myViewBounds.y);
         SwingUtilities.convertPointToScreen(point, parent);
         myViewBounds.x = point.x;
         myViewBounds.y = point.y;
       }
     }
     myView = null;
     if (update && visible) {
       setVisible(true);
     }
   }
 }
コード例 #4
0
ファイル: ScreenManager.java プロジェクト: Gogoro/Undef
 // get out of full screen
 public void restoreScreen() {
   Window w = vc.getFullScreenWindow();
   if (w != null) {
     w.dispose();
   }
   vc.setFullScreenWindow(null);
 }
コード例 #5
0
 /** Restores the screen's display mode. */
 public void restoreScreen() {
   Window window = device.getFullScreenWindow();
   if (window != null) {
     window.dispose();
   }
   device.setFullScreenWindow(null);
 }
コード例 #6
0
ファイル: ScreenManager.java プロジェクト: killgt/CryoWar
 /** Recupera el modo de pantalla no completa */
 public void recuperarPantalla() {
   Window window = device.getFullScreenWindow();
   if (window != null) {
     window.dispose();
   }
   device.setFullScreenWindow(null);
 }
コード例 #7
0
 @Override
 public void actionPerformed(ActionEvent e) {
   if (isDirty()) {
     _imgBtn.resetParameters();
   }
   _imgBtn.getWindow().close();
   _parent.dispose();
 }
コード例 #8
0
ファイル: MessagePopup.java プロジェクト: kares/F-ReC
 /**
  * Clear the error message and close the window. This can be called from outside this class. It is
  * called automatically when the user clicks the OK button or close box of the window that
  * displays the error message.
  */
 public synchronized void clearErrorMessage() {
   if (popup == null) return;
   popup.dispose();
   errorMessage = null;
   if (errorSource != null) errorSource.errorCleared();
   errorSource = null;
   popup = null;
 }
コード例 #9
0
  public void actionPerformed(ActionEvent e) {
    Object src = e.getSource();

    // Exit the window
    if (src == target.getFileItem(Window.FILE_ITEM_EXIT)) {
      target.dispose();
      System.exit(0);
    }

    // Show About window
    if (src == target.getHelpItem(Window.HELP_ITEM_ABOUT)) {
      new AboutWindow();
    }

    // Connect to a server
    if (src == target.getFileItem(Window.FILE_ITEM_CONNECT)) {
      new ConnectWindow(target);
    }

    // Disconnect
    if (src == target.getFileItem(Window.FILE_ITEM_DISCONNECT)) {
      target.DisConnect();
    }

    // Send File
    if (src == target.getToolItem(Window.TOOL_ITEM_SENDFILE)) {
      target.fileClient.Send();
    }

    // Send, send info to remote server.
    if (src == target.getSendBtn()) {
      if (target.isConncted()) {
        this.target.chatClient.Send(this.target.getBottomText());
        this.target.clearText();
      } else {
        this.target.AppendInfo("Please connect to a server first");
      }
    }

    // Cancel, close the window .
    if (src == target.getCancelBtn()) {
      target.dispose();
      System.exit(0);
    }
  }
コード例 #10
0
  void test1(Window owner, Window child) {
    System.out.println("* * * STAGE 1 * * *\nWindow owner: " + owner);

    owner.setFocusableWindowState(false);
    owner.setVisible(true);

    child.add(button);
    child.setVisible(true);

    Util.waitTillShown(child);

    Util.clickOnComp(button, robot);
    if (button == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
      throw new RuntimeException("Test Failed.");
    }
    child.dispose();
    owner.dispose();
  }
コード例 #11
0
ファイル: Util.java プロジェクト: zhemaituk/beanshell
 public static void endSplashScreen() {
   if (splashScreen != null) splashScreen.dispose();
 }