Package java.awt

Examples of java.awt.Window


    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(VideoPanel.class, "createVideo.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

        popup.show(this, x, y);
        return true;
    }

    private Frame getFrame() {
        Window w = SwingUtilities.getWindowAncestor(this);
        if (w instanceof Frame) {
            return ((Frame) w);
        }
        return null;
    }
View Full Code Here

  }

  private void setSizeAndDimensions(@NotNull JTable table, @NotNull JBPopup popup,
      @NotNull RelativePoint popupPosition, @NotNull List<UsageNode> data) {
    JComponent content = popup.getContent();
    Window window = SwingUtilities.windowForComponent(content);
    Dimension d = window.getSize();

    int width = calcMaxWidth(table);
    width = (int) Math.max(d.getWidth(), width);
    Dimension headerSize = ((AbstractPopup) popup).getHeaderPreferredSize();
    width = Math.max((int) headerSize.getWidth(), width);
    width = Math.max(myWidth, width);

    if (myWidth == -1) myWidth = width;
    int newWidth = Math.max(width, d.width + width - myWidth);

    myWidth = newWidth;

    int rowsToShow = Math.min(30, data.size());
    Dimension dimension = new Dimension(newWidth, table.getRowHeight() * rowsToShow);
    Rectangle rectangle = fitToScreen(dimension, popupPosition, table);
    dimension = rectangle.getSize();
    Point location = window.getLocation();
    if (!location.equals(rectangle.getLocation())) {
      window.setLocation(rectangle.getLocation());
    }

    if (!data.isEmpty()) {
      TableScrollingUtil.ensureSelectionExists(table);
    }
    table.setSize(dimension);
    //table.setPreferredSize(dimension);
    //table.setMaximumSize(dimension);
    //table.setPreferredScrollableViewportSize(dimension);

    Dimension footerSize = ((AbstractPopup) popup).getFooterPreferredSize();

    int newHeight = (int) (dimension.height + headerSize.getHeight() + footerSize.getHeight()) + 4/* invisible borders, margins etc*/;
    Dimension newDim = new Dimension(dimension.width, newHeight);
    window.setSize(newDim);
    window.setMinimumSize(newDim);
    window.setMaximumSize(newDim);

    window.validate();
    window.repaint();
    table.revalidate();
    table.repaint();
  }
View Full Code Here

        }

        Logger.debug("transparentWindowsSupport={}", transparentWindowsSupport);

        if(transparentWindowsSupport) {
            final Window test = new Window(null, WindowUtils.getAlphaCompatibleGraphicsConfiguration()) {
                private static final long serialVersionUID = 1L;

                @Override
                public void paint(Graphics g) {
                    Graphics2D g2 = (Graphics2D)g;

                    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                    g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);

                    g.setColor(Color.white);
                    g.fillRoundRect(100, 150, 100, 100, 32, 32);

                    g.setFont(new Font("Sans", Font.BOLD, 32));
                    g.drawString("Heavyweight overlay test", 100, 300);
                }
            };

            AWTUtilities.setWindowOpaque(test, false); // Doesn't work in full-screen exclusive
                                                       // mode, you would have to use 'simulated'
                                                       // full-screen - requires Sun/Oracle JDK
            test.setBackground(new Color(0, 0, 0, 0)); // This is what you do in JDK7

            // mediaPlayer.setOverlay(test);
            // mediaPlayer.enableOverlay(true);
        }
View Full Code Here

  }

  protected void applyThemeToApplication() {
    rootPane.updateUI();
    SwingUtilities.updateComponentTreeUI(rootPane);
    Window windows[] = Window.getWindows();
    for (int i = 0; i < windows.length; i++) {
      if (windows[i].isDisplayable()) {
        SwingUtilities.updateComponentTreeUI(windows[i]);
      }
    }
View Full Code Here

        if(overlay != null) {
            if(enable) {
                if(!overlay.isVisible()) {
                    overlay.setLocation(videoSurface.canvas().getLocationOnScreen());
                    overlay.setSize(videoSurface.canvas().getSize());
                    Window window = (Window)SwingUtilities.getAncestorOfClass(Window.class, videoSurface.canvas());
                    window.addComponentListener(overlayComponentAdapter);
                    overlay.setVisible(true);
                }
            }
            else {
                if(overlay.isVisible()) {
                    overlay.setVisible(false);
                    Window window = (Window)SwingUtilities.getAncestorOfClass(Window.class, videoSurface.canvas());
                    window.removeComponentListener(overlayComponentAdapter);
                }
            }
        }
    }
View Full Code Here

     */
    private void addOverlay(Window overlay) {
        Logger.debug("addOverlay(overlay={})", overlay);
        if(overlay != null) {
            this.overlay = overlay;
            Window window = (Window)SwingUtilities.getAncestorOfClass(Window.class, videoSurface.canvas());
            if(window != null) {
                window.addWindowListener(overlayWindowAdapter);
            }
            else {
                // This should not be possible
                Logger.warn("Failed to find a Window ancestor for the video surface Canvas");
            }
View Full Code Here

     * @param overlay overlay window
     */
    private void removeOverlay() {
        Logger.debug("removeOverlay()");
        if(overlay != null) {
            Window window = (Window)SwingUtilities.getAncestorOfClass(Window.class, videoSurface.canvas());
            window.removeWindowListener(overlayWindowAdapter);
            overlay = null;
        }
    }
View Full Code Here

import java.awt.Window;

public class BasicWindowMonitor extends WindowAdapter {

  public void windowClosing(WindowEvent e) {
    Window w = e.getWindow();
    w.setVisible(false);
    w.dispose();
    System.exit(0);
  }
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.