Package java.awt

Examples of java.awt.Window


     */
    public static void removeDialog(Window dialog) {
        checkInstance();

        for (int i = 0; i < DialogTracker.instance.size(); i++) {
            Window check = (Window) DialogTracker.instance.get(i);
            if (check == dialog) {
                DialogTracker.instance.remove(i);
                instance.kDialogs.remove(check);
                check.setVisible(false);
                check.dispose();
                i--;
            }
        }
    }
View Full Code Here


        dispose();
    }
   
    public static boolean wizardDialog(Component parent, String title, WizardModel model, JPanel sidePanel, Insets insets, boolean modal) {
        WizardDialog dialog = null;
        Window window = null;
        if(parent != null) {
            if(parent instanceof Frame || parent instanceof Dialog) {
                window = (Window)parent;
            }
            else {
                window = SwingUtilities.getWindowAncestor(parent);
            }
            if(window instanceof Dialog) {
                dialog = new WizardDialog((Dialog)window, title, model, sidePanel, insets, modal, window.getGraphicsConfiguration());
            }
            else {
                dialog = new WizardDialog((Frame)window, title, model, sidePanel, insets, modal, window.getGraphicsConfiguration());
            }
        }
        else {
            dialog = new WizardDialog((Frame)null, title, model, sidePanel, insets, modal, null);
        }
View Full Code Here

     */
    public static OptionsDialog createOptionDialog(Component parent, Option[] options, Object message, String title,
                                                   Option defaultOption, OptionCallback callback, Icon icon) {
        //
        OptionsDialog dialog = null;
        Window w = (Window) SwingUtilities.getAncestorOfClass(Window.class, parent);

        if (w instanceof JFrame) {
            dialog = new OptionsDialog((JFrame) w, options, message, title, defaultOption, callback, true, icon);
        } else if (w instanceof JDialog) {
            dialog = new OptionsDialog((JDialog) w, options, message, title, defaultOption, callback, true, icon);
View Full Code Here

            parentFrame = UIUtil.getFrameAncestor(this);
            if (parentFrame == null) {
                parentFrame = UIUtil.getSharedFrame();
            }
            parentFrame.addComponentListener(this);
            menuWindow = new Window(parentFrame);
            menuCanvas = new MenuCanvas();
            if(baseBackground != null) {
                menuCanvas.setBaseBackground(baseBackground);
            }
            if(baseForeground != null) {
View Full Code Here

        }
      };
    // Add a listener that closes the waiting dialog
    activeWindowListener = new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent ev) {
            final Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
            if (activeWindow != null) {
              try {
                ((JButton)TestUtilities.findComponent(activeWindow, JButton.class)).doClick();
              } catch (ComponentSearchException ex) {
                fail("No button in waiting dialog");
View Full Code Here

   * If the <code>imageUrl</code> is incorrect, nothing happens.
   */
  public static void showSplashScreenWindow(URL imageUrl) {
    try {
      final BufferedImage image = ImageIO.read(imageUrl);
      final Window splashScreenWindow = new Window(new Frame()) {
          @Override
          public void paint(Graphics g) {
            g.drawImage(image, 0, 0, this);
          }
        };
       
      splashScreenWindow.setSize(image.getWidth(), image.getHeight());
      splashScreenWindow.setLocationRelativeTo(null);
      splashScreenWindow.setVisible(true);
         
      Executors.newSingleThreadExecutor().execute(new Runnable() {
          public void run() {
            try {
              while (splashScreenWindow.isVisible()) {
                Thread.sleep(500);
                // If an other frame is created, dispose splash window
                EventQueue.invokeLater(new Runnable() {
                    public void run() {
                      if (Frame.getFrames().length > 1) {
                        splashScreenWindow.dispose();
                      }
                    }
                  });
              }
            } catch (InterruptedException ex) {
              EventQueue.invokeLater(new Runnable() {
                public void run() {
                  splashScreenWindow.dispose();
                }
              });
            };
          }
        });
View Full Code Here

    Dictionary<Integer,JComponent> qualitySliderLabelTable = new Hashtable<Integer,JComponent>();
    qualitySliderLabelTable.put(this.qualitySlider.getMinimum(), fastLabel);
    qualitySliderLabelTable.put(this.qualitySlider.getMaximum(), bestLabel);
    this.qualitySlider.setLabelTable(qualitySliderLabelTable);
    this.dialogTitle = preferences.getLocalizedString(PhotoPanel.class, "createPhoto.title");
    Window window = SwingUtilities.getWindowAncestor(this)
    if (window != null) {
      ((JDialog)window).setTitle(this.dialogTitle);
    }
    // Buttons text changes automatically through their action
  }
View Full Code Here

  /**
   * Manages closing of this pane.
   */
  private void close() {
    Window window = SwingUtilities.getWindowAncestor(this);
    if (window.isDisplayable()) {
      ToolTipManager.sharedInstance().unregisterComponent(this.qualitySlider);
      window.dispose();
    }   
  }
View Full Code Here

      parent.remove(componentIndex);
      parent.add(dummyLabel, componentIndex);
    }
   
    // Display view in a separate non modal dialog
    Window window = SwingUtilities.getWindowAncestor(this);
    if (!(window instanceof JFrame)) {
      window = JOptionPane.getRootFrame();
    }
    JFrame defaultFrame = (JFrame)window;
    // Create a dialog with the same title as home frame
View Full Code Here

    this.controller.setVisualProperty(view.getClass().getName() + DETACHED_VIEW_VISUAL_PROPERTY, false);
   
    JComponent dummyComponent = (JComponent)findChild(this, view.getClass().getName());
    if (dummyComponent != null) {
      JComponent component = (JComponent)view;
      Window window = SwingUtilities.getWindowAncestor(component);
      component.setBorder(dummyComponent.getBorder());     
      Container parent = dummyComponent.getParent();
      if (parent instanceof JSplitPane) {
        JSplitPane splitPane = (JSplitPane)parent;
        float dividerLocation = (Float)this.home.getVisualProperty(
            view.getClass().getName() + DETACHED_VIEW_DIVIDER_LOCATION_VISUAL_PROPERTY);
        splitPane.setDividerSize(UIManager.getInt("SplitPane.dividerSize"));
        splitPane.setDividerLocation(dividerLocation);
        if (splitPane.getLeftComponent() == dummyComponent) {
          splitPane.setLeftComponent(component);
        } else {
          splitPane.setRightComponent(component);
        }
      } else {
        int componentIndex = parent.getComponentZOrder(dummyComponent);
        parent.remove(componentIndex);
        parent.add(component, componentIndex);
      }
      window.dispose();
    }
  }
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.