Package javax.swing

Examples of javax.swing.JRootPane


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

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


  @RunsInEDT
  private static JRootPane newJRootPane() {
    return execute(new GuiQuery<JRootPane>() {
      @Override
      protected JRootPane executeInEDT() {
        return new JRootPane();
      }
    });
  }
View Full Code Here

        setMinimumSize(null);
        setBorder(null);
        super.updateUI();
        setMinimumSize(null);

        final JRootPane rootpane = getRootPane();
        setBorder(SwingToolkit.EMPTY_BORDER);
        removeAll();
        setLayout(new BorderLayout());
        //add(rootpane, BorderLayout.CENTER);
        setRootPane(rootpane);
        getLayout().layoutContainer(this);

        this.setOpaque(false);
        rootpane.setOpaque(false);
        getLayeredPane().setOpaque(false);
    }
View Full Code Here

  private void testBackground(TestHarness h)
  {
    // We even give it a potential value to set.
    UIManager.put("RootPane.background", Color.RED);
    TestRootUI ui = new TestRootUI();
    JRootPane rp = new JRootPane();
    rp.setBackground(null);
    ui.installDefaults(rp);
    h.check(rp.getBackground(), null);
  }
View Full Code Here

    final JComponent component = (JComponent) GuiUtil.getScrollPane(_component);
    if (component != null) {
      _component = component;
    }

    final JRootPane rootPane = SwingUtilities.getRootPane(component);
    if (rootPane != null) {
      _layerPane = rootPane.getLayeredPane();
      _popup = createSearchPopup(text);
      _layerPane.add(_popup, JLayeredPane.POPUP_LAYER);
      relocateAndResize();
      _popup.setVisible(true);
      _popup.validate();
View Full Code Here

    final JComponent component = (JComponent) GuiUtil.getScrollPane(_component);
    if (component != null) {
      _component = component;
    }

    final JRootPane rootPane = SwingUtilities.getRootPane(component);
    if (rootPane != null) {
      _layerPane = rootPane.getLayeredPane();
      initRecentSearchesPopup(true);
    }

  }
View Full Code Here

      {
        rootPane = rootPane.getParent();
      }
      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),
            (int) (rectangle.getY() - dimension.height), dimension.width, dimension.height);
        jRootPane.getLayeredPane().revalidate();
        jRootPane.getLayeredPane().repaint();
      }
    }
    if (getIcon() == noErrorIcon)
    {
      setIcon(errorIcon);
View Full Code Here

        protected void setLayersTransparent(Window w, boolean transparent) {

            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);
                    }
                    bg = (Color)root.getClientProperty(TRANSPARENT_OLD_BG);
                    root.putClientProperty(TRANSPARENT_OLD_BG, null);
                }
            }
            w.setBackground(bg);
        }
View Full Code Here

        }

        /** Indicates whether UpdateLayeredWindow is in use. */
        private boolean usingUpdateLayeredWindow(Window w) {
            if (w instanceof RootPaneContainer) {
                JRootPane root = ((RootPaneContainer)w).getRootPane();
                return root.getClientProperty(TRANSPARENT_OLD_BG) != null;
            }
            return false;
        }
View Full Code Here

        /** Keep track of the alpha level, since we can't read it from
         * the window itself.
         */
        private void storeAlpha(Window w, byte alpha) {
            if (w instanceof RootPaneContainer) {
                JRootPane root = ((RootPaneContainer)w).getRootPane();
                Byte b = alpha == (byte)0xFF ? null : new Byte(alpha);
                root.putClientProperty(TRANSPARENT_ALPHA, b);
            }
        }
View Full Code Here

TOP

Related Classes of javax.swing.JRootPane

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.