1. /*
  2. * @(#)RootPaneContainer.java 1.10 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing;
  8. import java.awt.Component;
  9. import java.awt.Container;
  10. /**
  11. * This interface is implemented by components that have a single
  12. * JRootPane child: JDialog, JFrame, JWindow, JApplet, JInternalFrame.
  13. * The methods in this interface are just <i>covers</i> for the JRootPane
  14. * properties, e.g. <code>getContentPane()</code> is generally implemented
  15. * like this:<pre>
  16. * public Container getContentPane() {
  17. * return getRootPane().getContentPane();
  18. * }
  19. * </pre>
  20. * This interface serves as a <i>marker</i> for Swing GUI builders
  21. * that need to treat components like JFrame, that contain a
  22. * single JRootPane, specially. For example in a GUI builder,
  23. * dropping a component on a RootPaneContainer would be interpreted
  24. * as <code>frame.getContentPane().add(child)</code>.
  25. *
  26. * @see JRootPane
  27. * @see JFrame
  28. * @see JDialog
  29. * @see JWindow
  30. * @see JApplet
  31. * @see JInternalFrame
  32. *
  33. * @version 1.10 11/29/01
  34. * @author Hans Muller
  35. */
  36. public interface RootPaneContainer
  37. {
  38. /**
  39. * Return this component's single JRootPane child. A conventional
  40. * implementation of this interface will have all of the other
  41. * methods indirect through this one. The rootPane has two
  42. * children: the glassPane and the layeredPane.
  43. *
  44. * @return this components single JRootPane child.
  45. * @see JRootPane
  46. */
  47. JRootPane getRootPane();
  48. /**
  49. * The "contentPane" is the primary container for application
  50. * specific components. Applications should add children to
  51. * the contentPane, set its layout manager, and so on.
  52. * <p>
  53. * The contentPane my not be null.
  54. * <p>
  55. * Generally implemented with
  56. * <code>getRootPane().setContentPane(contentPane);</code>
  57. *
  58. * @exception java.awt.IllegalComponentStateException (a runtime
  59. * exception) if the content pane parameter is null
  60. * @param contentPane the Container to use for the contents of this
  61. * JRootPane
  62. * @see JRootPane#getContentPane
  63. * @see #getContentPane
  64. */
  65. void setContentPane(Container contentPane);
  66. /**
  67. * Returns the contentPane.
  68. *
  69. * @return the value of the contentPane property.
  70. * @see #setContentPane
  71. */
  72. Container getContentPane();
  73. /**
  74. * A Container that manages the contentPane and in some cases a menu bar.
  75. * The layeredPane can be used by descendants that want to add a child
  76. * to the RootPaneContainer that isn't layout managed. For example
  77. * an internal dialog or a drag and drop effect component.
  78. * <p>
  79. * The layeredPane may not be null.
  80. * <p>
  81. * Generally implemented with<pre>
  82. * getRootPane().setLayeredPane(layeredPane);</pre>
  83. *
  84. * @exception java.awt.IllegalComponentStateException (a runtime
  85. * exception) if the layered pane parameter is null
  86. * @see #getLayeredPane
  87. * @see JRootPane#getLayeredPane
  88. */
  89. void setLayeredPane(JLayeredPane layeredPane);
  90. /**
  91. * Returns the layeredPane.
  92. *
  93. * @return the value of the layeredPane property.
  94. * @see #setLayeredPane
  95. */
  96. JLayeredPane getLayeredPane();
  97. /**
  98. * The glassPane is always the first child of the rootPane
  99. * and the rootPanes layout manager ensures that it's always
  100. * as big as the rootPane. By default it's transparent and
  101. * not visible. It can be used to temporarily grab all keyboard
  102. * and mouse input by adding listeners and then making it visible.
  103. * by default it's not visible.
  104. * <p>
  105. * The glassPane may not be null.
  106. * <p>
  107. * Generally implemented with
  108. * <code>getRootPane().setGlassPane(glassPane);</code>
  109. *
  110. * @see #getGlassPane
  111. * @see JRootPane#setGlassPane
  112. */
  113. void setGlassPane(Component glassPane);
  114. /**
  115. * Returns the glassPane.
  116. *
  117. * @return the value of the glassPane property.
  118. * @see #setGlassPane
  119. */
  120. Component getGlassPane();
  121. }