Package javax.swing

Examples of javax.swing.JLayeredPane


            /* closable */true,
            /* maximizable */true,
            /* iconifiable */true);
            setOpaque(true);

            JLayeredPane desktop = Environment.getInternalFrameDesktop();

            Debug.message("windows", "WindowSupport creating internal frame");

            if (desktop != null) {
                desktop.remove(this);
                desktop.add(this, JLayeredPane.PALETTE_LAYER);
            } else {
                Debug.output("WindowSupport:  No desktop set for internal frame");
            }
        }
View Full Code Here


        final String[] files = args;
       
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                JFrame frame = new JFrame("Swing Video Player");
                JLayeredPane layeredPane = new JLayeredPane();
                frame.add(layeredPane, BorderLayout.CENTER);
                final VideoPlayer full = new VideoPlayer(files[0]);
                full.setPreferredSize(new Dimension(1024, 768));
                full.setControlsVisible(true);
                full.setBounds(0, 0, 640, 480);
                full.getMediaPlayer().play();
                layeredPane.add(full, JLayeredPane.DEFAULT_LAYER);
                layeredPane.setPreferredSize(new Dimension(640, 480));
               
                // Add a panel just above the main video
                final JPanel pip = new JPanel();
                pip.setOpaque(false);
                pip.setBackground(new Color(0, 0, 0, 0));
                layeredPane.add(pip, new Integer(1));
                pip.setBounds(0, 0, 640, 480);
                pip.setLayout(new FlowLayout());
               
                // Add a button panel above that
                final JPanel controls = new JPanel();
                controls.setBounds(full.getBounds());
                controls.setLayout(new BorderLayout());
                layeredPane.add(controls, Integer.valueOf(2));
                final JPanel buttonPanel = new JPanel();
                buttonPanel.setLayout(new BorderLayout());
                JButton quit = new JButton("Quit");
                buttonPanel.add(quit, BorderLayout.WEST);
                quit.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent arg0) {
                        System.exit(0);
                    }
                });
                quit.setOpaque(false);
                controls.add(buttonPanel, BorderLayout.NORTH);
                controls.setOpaque(false);
                buttonPanel.setOpaque(false);
               
                layeredPane.addComponentListener(new ComponentAdapter() {

                    @Override
                    public void componentResized(ComponentEvent e) {
                        JComponent c = (JComponent) e.getComponent();
                        Rectangle r = c.getBounds();
View Full Code Here

    /*
     * Add a layered pane for the game area, so that we can have
     * windows on top of it
     */
    pane = new JLayeredPane();
    pane.setPreferredSize(screenSize);
    /*
     *  Set the sizes strictly so that the layout manager
     *  won't try to resize it
     */
 
View Full Code Here

    .contains("enabled=true").contains("visible=true").contains("showing=false");
  }

  @Test
  public void should_format_JLayeredPane() {
    JLayeredPane pane = newJLayeredPane();
    assertThat(formatted(pane)).isEqualTo("javax.swing.JLayeredPane[]");
  }
View Full Code Here

    JLayeredPane pane = newJLayeredPane();
    assertThat(formatted(pane)).isEqualTo("javax.swing.JLayeredPane[]");
  }

  private static JLayeredPane newJLayeredPane() {
    return new JLayeredPane();
  }
View Full Code Here

     * @param c the container
     * @return the cells
     */
    public List getLayoutCells(Container c)
    {
        JLayeredPane lp = (JLayeredPane)c;
        Component[] childs = lp.getComponentsInLayer(JLayeredPane.FRAME_CONTENT_LAYER.intValue());
        return getLayoutHelper(c).getCells(childs);
    }
View Full Code Here

      if (rootPane != null)
      {
        final JRootPane jRootPane = (JRootPane) rootPane;

        final JLabel errorPopup = createPopup();
        final JLayeredPane jLayeredPane = jRootPane.getLayeredPane();
        jLayeredPane.add(errorPopup, JLayeredPane.POPUP_LAYER);
       
        final Rectangle rectangle = SwingUtilities.convertRectangle
            (getParent(), getBounds(), jRootPane.getLayeredPane());
        final Dimension dimension = errorPopup.getPreferredSize();
        errorPopup.setBounds((int) (rectangle.getX() - dimension.width),
View Full Code Here

            Color bg = transparent ? new Color(0, 0, 0, 0) : null;
            if (w instanceof RootPaneContainer) {
                RootPaneContainer rpc = (RootPaneContainer)w;
                JRootPane root = rpc.getRootPane();
                JLayeredPane lp = root.getLayeredPane();
                Container c = root.getContentPane();
                JComponent content =
                    (c instanceof JComponent) ? (JComponent)c : null;
                if (transparent) {
                    lp.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                         Boolean.valueOf(lp.isOpaque()));
                    lp.setOpaque(false);
                    root.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                           Boolean.valueOf(root.isOpaque()));
                    root.setOpaque(false);
                    if (content != null) {
                        content.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                                  Boolean.valueOf(content.isOpaque()));
                        content.setOpaque(false);
                    }
                    root.putClientProperty(TRANSPARENT_OLD_BG,
                                           root.getParent().getBackground());
                }
                else {
                    lp.setOpaque(Boolean.TRUE.equals(lp.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                    lp.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
                    root.setOpaque(Boolean.TRUE.equals(root.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                    root.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
                    if (content != null) {
                        content.setOpaque(Boolean.TRUE.equals(content.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                        content.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
View Full Code Here

                public void run() {
                    User32 user = User32.INSTANCE;
                    HWND hWnd = getHWnd(w);
                    int flags = user.GetWindowLong(hWnd, WinUser.GWL_EXSTYLE);
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof W32TransparentContentPane) {
                        ((W32TransparentContentPane)content).setTransparent(transparent);
                    }
                    else if (transparent) {
                        W32TransparentContentPane w32content =
                            new W32TransparentContentPane(content);
                        root.setContentPane(w32content);
                        lp.add(new RepaintTrigger(w32content),
                               JLayeredPane.DRAG_LAYER);
                    }
                    if (transparent && !usingUpdateLayeredWindow(w)) {
                        flags |= WinUser.WS_EX_LAYERED;
                        user.SetWindowLong(hWnd, WinUser.GWL_EXSTYLE, flags);
View Full Code Here

            if (transparent == isTransparent)
                return;
            whenDisplayable(w, new Runnable() {
                public void run() {
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof X11TransparentContentPane) {
                        ((X11TransparentContentPane)content).setTransparent(transparent);
                    }
                    else if (transparent) {
                        X11TransparentContentPane x11content =
                            new X11TransparentContentPane(content);
                        root.setContentPane(x11content);
                        lp.add(new RepaintTrigger(x11content),
                               JLayeredPane.DRAG_LAYER);
                    }
                    setLayersTransparent(w, transparent);
                    setForceHeavyweightPopups(w, transparent);
                    setDoubleBuffered(w, !transparent);
View Full Code Here

TOP

Related Classes of javax.swing.JLayeredPane

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.