74689cbcc0cebbd857a50b155293b82d7403df78al_xipe/*
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * This code is free software; you can redistribute it and/or modify it
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * under the terms of the GNU General Public License version 2 only, as
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * published by the Free Software Foundation. Oracle designates this
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * particular file as subject to the "Classpath" exception as provided
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * by Oracle in the LICENSE file that accompanied this code.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * This code is distributed in the hope that it will be useful, but WITHOUT
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * version 2 for more details (a copy is included in the LICENSE file that
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * accompanied this code).
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * You should have received a copy of the GNU General Public License version
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * 2 along with this work; if not, write to the Free Software Foundation,
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * or visit www.oracle.com if you need additional information or have any
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * questions.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe */
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe
74689cbcc0cebbd857a50b155293b82d7403df78al_xipepackage javax.swing;
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe
74689cbcc0cebbd857a50b155293b82d7403df78al_xipeimport java.awt.Component;
74689cbcc0cebbd857a50b155293b82d7403df78al_xipeimport java.awt.Container;
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe/**
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * This interface is implemented by components that have a single
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * JRootPane child: JDialog, JFrame, JWindow, JApplet, JInternalFrame.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * The methods in this interface are just <i>covers</i> for the JRootPane
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * properties, e.g. <code>getContentPane()</code> is generally implemented
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * like this:<pre>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * public Container getContentPane() {
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * return getRootPane().getContentPane();
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * }
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * </pre>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * This interface serves as a <i>marker</i> for Swing GUI builders
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * that need to treat components like JFrame, that contain a
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * single JRootPane, specially. For example in a GUI builder,
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * dropping a component on a RootPaneContainer would be interpreted
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * as <code>frame.getContentPane().add(child)</code>.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <p>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * For conveniance
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <code>JFrame</code>, <code>JDialog</code>, <code>JWindow</code>,
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <code>JApplet</code> and <code>JInternalFrame</code>, by default,
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * forward, by default, all calls to the <code>add</code>,
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <code>remove</code> and <code>setLayout</code> methods, to the
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <code>contentPane</code>. This means you can call:
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <pre>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * rootPaneContainer.add(component);
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * </pre>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * instead of:
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <pre>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * rootPaneContainer.getContentPane().add(component);
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * </pre>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <p>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * The behavior of the <code>add</code> and
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <code>setLayout</code> methods for
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <code>JFrame</code>, <code>JDialog</code>, <code>JWindow</code>,
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <code>JApplet</code> and <code>JInternalFrame</code> is controlled by
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * the <code>rootPaneCheckingEnabled</code> property. If this property is
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * true (the default), then calls to these methods are
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * forwarded to the <code>contentPane</code>; if false, these
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * methods operate directly on the <code>RootPaneContainer</code>. This
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * property is only intended for subclasses, and is therefore protected.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see JRootPane
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see JFrame
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see JDialog
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see JWindow
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see JApplet
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see JInternalFrame
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @author Hans Muller
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe */
74689cbcc0cebbd857a50b155293b82d7403df78al_xipepublic interface RootPaneContainer
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe{
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe /**
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * Return this component's single JRootPane child. A conventional
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * implementation of this interface will have all of the other
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * methods indirect through this one. The rootPane has two
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * children: the glassPane and the layeredPane.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @return this components single JRootPane child.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see JRootPane
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe */
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe JRootPane getRootPane();
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe /**
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * The "contentPane" is the primary container for application
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * specific components. Applications should add children to
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * the contentPane, set its layout manager, and so on.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <p>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * The contentPane may not be null.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <p>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * Generally implemented with
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * <code>getRootPane().setContentPane(contentPane);</code>
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @exception java.awt.IllegalComponentStateException (a runtime
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * exception) if the content pane parameter is null
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @param contentPane the Container to use for the contents of this
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * JRootPane
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see JRootPane#getContentPane
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see #getContentPane
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe */
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe void setContentPane(Container contentPane);
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe /**
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * Returns the contentPane.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe *
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @return the value of the contentPane property.
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe * @see #setContentPane
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe */
74689cbcc0cebbd857a50b155293b82d7403df78al_xipe Container getContentPane();
/**
* A Container that manages the contentPane and in some cases a menu bar.
* The layeredPane can be used by descendants that want to add a child
* to the RootPaneContainer that isn't layout managed. For example
* an internal dialog or a drag and drop effect component.
* <p>
* The layeredPane may not be null.
* <p>
* Generally implemented with<pre>
* getRootPane().setLayeredPane(layeredPane);</pre>
*
* @exception java.awt.IllegalComponentStateException (a runtime
* exception) if the layered pane parameter is null
* @see #getLayeredPane
* @see JRootPane#getLayeredPane
*/
void setLayeredPane(JLayeredPane layeredPane);
/**
* Returns the layeredPane.
*
* @return the value of the layeredPane property.
* @see #setLayeredPane
*/
JLayeredPane getLayeredPane();
/**
* The glassPane is always the first child of the rootPane
* and the rootPanes layout manager ensures that it's always
* as big as the rootPane. By default it's transparent and
* not visible. It can be used to temporarily grab all keyboard
* and mouse input by adding listeners and then making it visible.
* by default it's not visible.
* <p>
* The glassPane may not be null.
* <p>
* Generally implemented with
* <code>getRootPane().setGlassPane(glassPane);</code>
*
* @see #getGlassPane
* @see JRootPane#setGlassPane
*/
void setGlassPane(Component glassPane);
/**
* Returns the glassPane.
*
* @return the value of the glassPane property.
* @see #setGlassPane
*/
Component getGlassPane();
}