jdk/src/java.desktop/share/classes/javax/swing/RootPaneContainer.java
author darcy
Fri, 03 Apr 2015 10:41:34 -0700
changeset 29894 3e16b51732f5
parent 25859 3317bb8137f4
permissions -rw-r--r--
8076520: Fix missing doclint warnings in javax.swing.{table, tree, undo, plaf.{metal, nimbus, synth}} Reviewed-by: alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 21255
diff changeset
     2
 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.swing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.Component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.Container;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * This interface is implemented by components that have a single
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * JRootPane child: JDialog, JFrame, JWindow, JApplet, JInternalFrame.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * The methods in  this interface are just <i>covers</i> for the JRootPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * properties, e.g. <code>getContentPane()</code> is generally implemented
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * like this:<pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *     public Container getContentPane() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *         return getRootPane().getContentPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * This interface serves as a <i>marker</i> for Swing GUI builders
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * that need to treat components like JFrame, that contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * single JRootPane, specially.  For example in a GUI builder,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * dropping a component on a RootPaneContainer would be interpreted
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * as <code>frame.getContentPane().add(child)</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <p>
21255
0afb44cd0215 7165112: Incomprehensible garbage in doc for RootPaneContainer
malenkov
parents: 5506
diff changeset
    48
 * As a convenience, the standard classes that implement this interface
0afb44cd0215 7165112: Incomprehensible garbage in doc for RootPaneContainer
malenkov
parents: 5506
diff changeset
    49
 * (such as {@code JFrame}, {@code JDialog}, {@code JWindow}, {@code JApplet},
0afb44cd0215 7165112: Incomprehensible garbage in doc for RootPaneContainer
malenkov
parents: 5506
diff changeset
    50
 * and {@code JInternalFrame}) have their {@code add}, {@code remove},
0afb44cd0215 7165112: Incomprehensible garbage in doc for RootPaneContainer
malenkov
parents: 5506
diff changeset
    51
 * and {@code setLayout} methods overridden, so that they delegate calls
0afb44cd0215 7165112: Incomprehensible garbage in doc for RootPaneContainer
malenkov
parents: 5506
diff changeset
    52
 * to the corresponding methods of the {@code ContentPane}.
0afb44cd0215 7165112: Incomprehensible garbage in doc for RootPaneContainer
malenkov
parents: 5506
diff changeset
    53
 * For example, you can add a child component to a frame as follows:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * <pre>
21255
0afb44cd0215 7165112: Incomprehensible garbage in doc for RootPaneContainer
malenkov
parents: 5506
diff changeset
    55
 *       frame.add(child);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * instead of:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <pre>
21255
0afb44cd0215 7165112: Incomprehensible garbage in doc for RootPaneContainer
malenkov
parents: 5506
diff changeset
    59
 *       frame.getContentPane().add(child);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * The behavior of the <code>add</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * <code>setLayout</code> methods for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * <code>JFrame</code>, <code>JDialog</code>, <code>JWindow</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <code>JApplet</code> and <code>JInternalFrame</code> is controlled by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * the <code>rootPaneCheckingEnabled</code> property. If this property is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * true (the default), then calls to these methods are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
  * forwarded to the <code>contentPane</code>; if false, these
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
  * methods operate directly on the <code>RootPaneContainer</code>. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
  * property is only intended for subclasses, and is therefore protected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * @see JRootPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * @see JFrame
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * @see JDialog
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * @see JWindow
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * @see JApplet
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * @see JInternalFrame
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * @author Hans Muller
25201
4adc75e0c4e5 8046485: Add missing @since tag under javax.swing.*
henryjen
parents: 24983
diff changeset
    80
 * @since 1.2
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
public interface RootPaneContainer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * Return this component's single JRootPane child.  A conventional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * implementation of this interface will have all of the other
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * methods indirect through this one.  The rootPane has two
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * children: the glassPane and the layeredPane.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @return this components single JRootPane child.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * @see JRootPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    JRootPane getRootPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * The "contentPane" is the primary container for application
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * specific components.  Applications should add children to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * the contentPane, set its layout manager, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * The contentPane may not be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * Generally implemented with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * <code>getRootPane().setContentPane(contentPane);</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @exception java.awt.IllegalComponentStateException (a runtime
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     *            exception) if the content pane parameter is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @param contentPane the Container to use for the contents of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     *        JRootPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * @see JRootPane#getContentPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * @see #getContentPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    void setContentPane(Container contentPane);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * Returns the contentPane.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @return the value of the contentPane property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @see #setContentPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    Container getContentPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * A Container that manages the contentPane and in some cases a menu bar.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * The layeredPane can be used by descendants that want to add a child
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * to the RootPaneContainer that isn't layout managed.  For example
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * an internal dialog or a drag and drop effect component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * The layeredPane may not be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * Generally implemented with<pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     *    getRootPane().setLayeredPane(layeredPane);</pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
24983
f5a6e2ed8c7d 8046596: fix doclint issues in swing classes, part 3 of 4
yan
parents: 23010
diff changeset
   136
     * @param layeredPane the layered pane
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @exception java.awt.IllegalComponentStateException (a runtime
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *            exception) if the layered pane parameter is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @see #getLayeredPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @see JRootPane#getLayeredPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    void setLayeredPane(JLayeredPane layeredPane);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * Returns the layeredPane.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @return the value of the layeredPane property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @see #setLayeredPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    JLayeredPane getLayeredPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * The glassPane is always the first child of the rootPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * and the rootPanes layout manager ensures that it's always
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * as big as the rootPane.  By default it's transparent and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * not visible.  It can be used to temporarily grab all keyboard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * and mouse input by adding listeners and then making it visible.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * by default it's not visible.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * The glassPane may not be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * Generally implemented with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * <code>getRootPane().setGlassPane(glassPane);</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     *
24983
f5a6e2ed8c7d 8046596: fix doclint issues in swing classes, part 3 of 4
yan
parents: 23010
diff changeset
   167
     * @param glassPane the glass pane
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * @see #getGlassPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * @see JRootPane#setGlassPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    void setGlassPane(Component glassPane);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * Returns the glassPane.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @return the value of the glassPane property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @see #setGlassPane
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    Component getGlassPane();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
}