[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: rootPaneChecking fixed in Swing top-level containers
From: |
Roman Kennke |
Subject: |
[cp-patches] FYI: rootPaneChecking fixed in Swing top-level containers |
Date: |
Mon, 07 Nov 2005 22:11:01 +0000 |
Hi,
I fixed the handling of the rootPaneCheckingEnabled property in Swing's
toplevel containers. The situation before was that this property was
only used to decide if an exception should be thrown or not if an
attempt was made to add a component to (or set the layout for) a
toplevel swing container. We had a private boolean field that indicated
if we are in the init phase or not which was used to decide if adds and
setLayout go to the container directly or to its contentPane.
I observed that the JDK1.5 (in which this property was introduced) never
throws an Exception when add or setLayout is called, and actually used
the rootPaneCheckingEnabled property to decide where the add and
setLayout should go. I checked in a couple of Mauve tests for this and
here comes the fix.
This contains some more fixlets for JInternalFrame, most notably we need
to switch to init mode in the setUI and updateUI methods so that the UI
initialization can work on the JInternalFrame directly and not on its
contentPane. And yes, we need to do this in both methods, since
subclasses commonly override one of these two, but not necessarily both.
2005-11-07 Roman Kennke <address@hidden>
* javax/swing/JApplet.java
(initStageDone): Removed unnecessary field.
(JApplet): Use rootPaneCheckingEnabled property instead of
initStageDone field.
(setLayout): Likewise.
(addImpl): Likewise.
* javax/swing/JDialog.java
(initStageDone): Removed unnecessary field.
(dialogInit): Use rootPaneCheckingEnabled property instead of
initStageDone field.
(setLayout): Likewise.
(addImpl): Likewise.
* javax/swing/JFrame.java
(initStageDone): Removed unnecessary field.
(frameInit): Use rootPaneCheckingEnabled property instead of
initStageDone field.
(setLayout): Likewise.
(addImpl): Likewise.
* javax/swing/JWindow.java
(initStageDone): Removed unnecessary field.
(windowInit): Use rootPaneCheckingEnabled property instead of
initStageDone field.
(setLayout): Likewise.
(addImpl): Likewise.
* javax/swing/JInternalFrame.java
(initStageDone): Removed unnecessary field.
(JInternalFrame): Use rootPaneCheckingEnabled property instead of
initStageDone field.
(setLayout): Likewise.
(addImpl): Likewise.
(paramString): Return superclass paramstring.
(reshape): Call revalidate() instead of invalidate() and
doLayout().
(setUI): Temporarily go into init mode, so that the UI can
manipulate the frame directly.
(updateUI): Likewise.
/Roman
rootPaneCheckingEnabled.diff
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: rootPaneChecking fixed in Swing top-level containers,
Roman Kennke <=