Package javax.swing

Examples of javax.swing.RootPaneContainer


     *            a flag whether to create a glass pane if one does not exist
     * @return GlassPane
     */
    public synchronized static GlassPane mount(Component startComponent,
            boolean create) {
        RootPaneContainer aContainer = null;
        Component aComponent = startComponent;

        // Climb the component hierarchy until a RootPaneContainer is found or
        // until the very top
        while ((aComponent.getParent() != null)
                && !(aComponent instanceof RootPaneContainer)) {
            aComponent = aComponent.getParent();
        }

        // Guard against error conditions if climb search wasn't successful
        if (aComponent instanceof RootPaneContainer) {
            aContainer = (RootPaneContainer)aComponent;
        }

        if (aContainer != null) {
            // Retrieve an existing GlassPane if old one already exist or create
            // a new one, otherwise return null
            if ((aContainer.getGlassPane() != null)
                    && (aContainer.getGlassPane() instanceof GlassPane)) {
                return (GlassPane)aContainer.getGlassPane();
            } else if (create) {
                GlassPane aGlassPane = new GlassPane(startComponent);
                aContainer.setGlassPane(aGlassPane);

                /*
                System.err.println("GlassPane mounted on "
                        + aContainer.getClass());
                */
 
View Full Code Here


                return EditedComponent.NOTE;
            }
    };
    final IEditBaseCreator textFieldCreator = (IEditBaseCreator) Controller.getCurrentController().getMapViewManager();
    mCurrentEditDialog = textFieldCreator.createEditor(nodeModel, editControl, text, true);
    final RootPaneContainer frame = (RootPaneContainer) SwingUtilities.getWindowAncestor(controller.getMapViewManager().getMapViewComponent());
    mCurrentEditDialog.show(frame);

    }
View Full Code Here

    }
  }
 
  public void setSearchingBusyCursor()
  {
    RootPaneContainer root = (RootPaneContainer)getTopLevelAncestor();
    root.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    root.getGlassPane().setVisible(true);
  }
View Full Code Here

    root.getGlassPane().setVisible(true);
  }
 
  public void setSearchingDefaultCursor()
  {
    RootPaneContainer root = (RootPaneContainer)getTopLevelAncestor();
    root.getGlassPane().setCursor(Cursor.getDefaultCursor());
    root.getGlassPane().setVisible(false);
  }
View Full Code Here

      public EditedComponent getEditType() {
                return EditedComponent.DETAIL;
            }
    };
    mCurrentEditDialog = createEditor(nodeModel, editControl, text, false, editLong, true);
    final RootPaneContainer frame = (RootPaneContainer) SwingUtilities.getWindowAncestor(controller.getMapViewManager().getMapViewComponent());
    mCurrentEditDialog.show(frame);
    }
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) {
View Full Code Here

        private OSXMaskingContentPane installMaskingPane(Window w) {
            OSXMaskingContentPane content;
            if (w instanceof RootPaneContainer) {
                // TODO: replace layered pane instead?
                final RootPaneContainer rpc = (RootPaneContainer)w;
                Container oldContent = rpc.getContentPane();
                if (oldContent instanceof OSXMaskingContentPane) {
                    content = (OSXMaskingContentPane)oldContent;
                }
                else {
                    content = new OSXMaskingContentPane(oldContent);
                    // TODO: listen for content pane changes
                    rpc.setContentPane(content);
                }
            }
            else {
                Component oldContent = w.getComponentCount() > 0 ? w.getComponent(0) : null;
                if (oldContent instanceof OSXMaskingContentPane) {
View Full Code Here

        assertFalse(floatingFrame.isResizable());
    }

    public void testCreateFloatingWindow() {
        toolBar.setName("The toolbar");
        RootPaneContainer floatingWindow = ui.createFloatingWindow(toolBar);
        assertTrue(floatingWindow instanceof JDialog);
        JDialog floatingFrame = (JDialog) floatingWindow;
        assertFalse(floatingFrame.isAncestorOf(toolBar));
        assertEquals("The toolbar", floatingFrame.getTitle());
        assertTrue(floatingFrame.getWindowListeners().length > 0);
View Full Code Here

            return nonRolloverBorder;
        }

        @Override
        protected RootPaneContainer createFloatingWindow(final JToolBar toolbar) {
            RootPaneContainer result = super.createFloatingWindow(toolbar);
            if (result instanceof Container) {
                floatingWindow = (Container) result;
            }
            return result;
        }
View Full Code Here

    // especially necessary to avoid an AWT leak bug (6411042).
    final AwtContext currentContext = awtContext;
    EventQueue.invokeLater(new Runnable() {
      public void run() {

        RootPaneContainer container = addRootPaneContainer(currentContext
            .getFrame());
        JComponent swingComponent = createSwingComponent();
        currentContext.setSwingComponent(swingComponent);
        container.getRootPane().getContentPane().add(swingComponent);
        setComponentFont();
      }
    });
  }
View Full Code Here

TOP

Related Classes of javax.swing.RootPaneContainer

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.