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