161 * The painting architecture of Swing requires an opaque
162 * <code>JComponent</code>
163 * to exist in the containment hierarchy above all other components. This is
164 * typically provided by way of the content pane. If you replace the content
165 * pane, it is recommended that you make the content pane opaque
166 * by way of <code>setOpaque(true)</code>. Additionally, if the content pane
167 * overrides <code>paintComponent</code>, it
168 * will need to completely fill in the background in an opaque color in
169 * <code>paintComponent</code>.
170 * <p>
171 * <strong>Warning:</strong> Swing is not thread safe. For more
172 * information see <a
173 * href="package-summary.html#threading">Swing's Threading
174 * Policy</a>.
175 * <p>
176 * <strong>Warning:</strong>
177 * Serialized objects of this class will not be compatible with
178 * future Swing releases. The current serialization support is
179 * appropriate for short term storage or RMI between applications running
180 * the same version of Swing. As of 1.4, support for long term storage
181 * of all JavaBeans™
182 * has been added to the <code>java.beans</code> package.
183 * Please see {@link java.beans.XMLEncoder}.
184 *
185 * @see JLayeredPane
186 * @see JMenuBar
187 * @see JWindow
188 * @see JFrame
189 * @see JDialog
190 * @see JApplet
191 * @see JInternalFrame
192 * @see JComponent
193 * @see BoxLayout
194 *
195 * @see <a href="http://www.oracle.com/technetwork/articles/java/mixing-components-433992.html">
196 * Mixing Heavy and Light Components</a>
197 *
198 * @author David Kloba
199 * @since 1.2
200 */
201 /// PENDING(klobad) Who should be opaque in this component?
823 && getComponent(0) != glassPane) {
824 add(glassPane, 0);
825 }
826 }
827
828
829 ///////////////////////////////////////////////////////////////////////////////
830 //// Begin Inner Classes
831 ///////////////////////////////////////////////////////////////////////////////
832
833
834 /**
835 * A custom layout manager that is responsible for the layout of
836 * layeredPane, glassPane, and menuBar.
837 * <p>
838 * <strong>Warning:</strong>
839 * Serialized objects of this class will not be compatible with
840 * future Swing releases. The current serialization support is
841 * appropriate for short term storage or RMI between applications running
842 * the same version of Swing. As of 1.4, support for long term storage
843 * of all JavaBeans™
844 * has been added to the <code>java.beans</code> package.
845 * Please see {@link java.beans.XMLEncoder}.
846 */
847 @SuppressWarnings("serial")
848 protected class RootLayout implements LayoutManager2, Serializable
849 {
850 /**
851 * Returns the amount of space the layout would like to have.
852 *
853 * @param parent the Container for which this layout manager
854 * is being used
855 * @return a Dimension object containing the layout's preferred size
856 */
857 public Dimension preferredLayoutSize(Container parent) {
858 Dimension rd, mbd;
859 Insets i = getInsets();
860
861 if(contentPane != null) {
862 rd = contentPane.getPreferredSize();
863 } else {
989 * @return an <code>AccessibleJRootPane</code> that serves as the
990 * <code>AccessibleContext</code> of this <code>JRootPane</code>
991 */
992 public AccessibleContext getAccessibleContext() {
993 if (accessibleContext == null) {
994 accessibleContext = new AccessibleJRootPane();
995 }
996 return accessibleContext;
997 }
998
999 /**
1000 * This class implements accessibility support for the
1001 * <code>JRootPane</code> class. It provides an implementation of the
1002 * Java Accessibility API appropriate to root pane user-interface elements.
1003 * <p>
1004 * <strong>Warning:</strong>
1005 * Serialized objects of this class will not be compatible with
1006 * future Swing releases. The current serialization support is
1007 * appropriate for short term storage or RMI between applications running
1008 * the same version of Swing. As of 1.4, support for long term storage
1009 * of all JavaBeans™
1010 * has been added to the <code>java.beans</code> package.
1011 * Please see {@link java.beans.XMLEncoder}.
1012 */
1013 @SuppressWarnings("serial")
1014 protected class AccessibleJRootPane extends AccessibleJComponent {
1015 /**
1016 * Get the role of this object.
1017 *
1018 * @return an instance of AccessibleRole describing the role of
1019 * the object
1020 */
1021 public AccessibleRole getAccessibleRole() {
1022 return AccessibleRole.ROOT_PANE;
1023 }
1024
1025 /**
1026 * Returns the number of accessible children of the object.
1027 *
1028 * @return the number of accessible children of the object.
1029 */
|
161 * The painting architecture of Swing requires an opaque
162 * <code>JComponent</code>
163 * to exist in the containment hierarchy above all other components. This is
164 * typically provided by way of the content pane. If you replace the content
165 * pane, it is recommended that you make the content pane opaque
166 * by way of <code>setOpaque(true)</code>. Additionally, if the content pane
167 * overrides <code>paintComponent</code>, it
168 * will need to completely fill in the background in an opaque color in
169 * <code>paintComponent</code>.
170 * <p>
171 * <strong>Warning:</strong> Swing is not thread safe. For more
172 * information see <a
173 * href="package-summary.html#threading">Swing's Threading
174 * Policy</a>.
175 * <p>
176 * <strong>Warning:</strong>
177 * Serialized objects of this class will not be compatible with
178 * future Swing releases. The current serialization support is
179 * appropriate for short term storage or RMI between applications running
180 * the same version of Swing. As of 1.4, support for long term storage
181 * of all JavaBeans
182 * has been added to the <code>java.beans</code> package.
183 * Please see {@link java.beans.XMLEncoder}.
184 *
185 * @see JLayeredPane
186 * @see JMenuBar
187 * @see JWindow
188 * @see JFrame
189 * @see JDialog
190 * @see JApplet
191 * @see JInternalFrame
192 * @see JComponent
193 * @see BoxLayout
194 *
195 * @see <a href="http://www.oracle.com/technetwork/articles/java/mixing-components-433992.html">
196 * Mixing Heavy and Light Components</a>
197 *
198 * @author David Kloba
199 * @since 1.2
200 */
201 /// PENDING(klobad) Who should be opaque in this component?
823 && getComponent(0) != glassPane) {
824 add(glassPane, 0);
825 }
826 }
827
828
829 ///////////////////////////////////////////////////////////////////////////////
830 //// Begin Inner Classes
831 ///////////////////////////////////////////////////////////////////////////////
832
833
834 /**
835 * A custom layout manager that is responsible for the layout of
836 * layeredPane, glassPane, and menuBar.
837 * <p>
838 * <strong>Warning:</strong>
839 * Serialized objects of this class will not be compatible with
840 * future Swing releases. The current serialization support is
841 * appropriate for short term storage or RMI between applications running
842 * the same version of Swing. As of 1.4, support for long term storage
843 * of all JavaBeans
844 * has been added to the <code>java.beans</code> package.
845 * Please see {@link java.beans.XMLEncoder}.
846 */
847 @SuppressWarnings("serial")
848 protected class RootLayout implements LayoutManager2, Serializable
849 {
850 /**
851 * Returns the amount of space the layout would like to have.
852 *
853 * @param parent the Container for which this layout manager
854 * is being used
855 * @return a Dimension object containing the layout's preferred size
856 */
857 public Dimension preferredLayoutSize(Container parent) {
858 Dimension rd, mbd;
859 Insets i = getInsets();
860
861 if(contentPane != null) {
862 rd = contentPane.getPreferredSize();
863 } else {
989 * @return an <code>AccessibleJRootPane</code> that serves as the
990 * <code>AccessibleContext</code> of this <code>JRootPane</code>
991 */
992 public AccessibleContext getAccessibleContext() {
993 if (accessibleContext == null) {
994 accessibleContext = new AccessibleJRootPane();
995 }
996 return accessibleContext;
997 }
998
999 /**
1000 * This class implements accessibility support for the
1001 * <code>JRootPane</code> class. It provides an implementation of the
1002 * Java Accessibility API appropriate to root pane user-interface elements.
1003 * <p>
1004 * <strong>Warning:</strong>
1005 * Serialized objects of this class will not be compatible with
1006 * future Swing releases. The current serialization support is
1007 * appropriate for short term storage or RMI between applications running
1008 * the same version of Swing. As of 1.4, support for long term storage
1009 * of all JavaBeans
1010 * has been added to the <code>java.beans</code> package.
1011 * Please see {@link java.beans.XMLEncoder}.
1012 */
1013 @SuppressWarnings("serial")
1014 protected class AccessibleJRootPane extends AccessibleJComponent {
1015 /**
1016 * Get the role of this object.
1017 *
1018 * @return an instance of AccessibleRole describing the role of
1019 * the object
1020 */
1021 public AccessibleRole getAccessibleRole() {
1022 return AccessibleRole.ROOT_PANE;
1023 }
1024
1025 /**
1026 * Returns the number of accessible children of the object.
1027 *
1028 * @return the number of accessible children of the object.
1029 */
|