I fixed the remaining JWindow constructors to also accept null owner
arguments. This involved modifying the SwingUtilities.getOwnerFrame()
signature once more, and adding casts to the statements that call this
method.
2006-01-19 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/JWindow.java
(JWindow(Window)): Fixed to accept null owner argument.
(JWindow(Window,GraphicsConfiguration)): Fixed to accept null
owner argument.
* javax/swing/SwingUtilities.java
(getOwnerFrame): Owner parameter and return value are fixed to
be of type Window for compatibity with the above JWindow
constructor.
* javax/swing/JDialog.java
(JDialog): Added cast to Frame to make sure the correct
constructor
is called.
* javax/swing/JFileChooser.java
(createDialog): Added cast to Frame for JDialog constructor.
/Roman
Index: javax/swing/JWindow.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JWindow.java,v
retrieving revision 1.24
diff -u -r1.24 JWindow.java
--- javax/swing/JWindow.java 19 Jan 2006 22:16:21 -0000 1.24
+++ javax/swing/JWindow.java 19 Jan 2006 22:21:50 -0000
@@ -133,7 +133,7 @@
*/
public JWindow(Window owner)
{
- super(owner);
+ super(SwingUtilities.getOwnerFrame(owner));
windowInit();
}
@@ -152,7 +152,7 @@
*/
public JWindow(Window owner, GraphicsConfiguration gc)
{
- super(owner, gc);
+ super(SwingUtilities.getOwnerFrame(owner), gc);
windowInit();
}
Index: javax/swing/SwingUtilities.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SwingUtilities.java,v
retrieving revision 1.41
diff -u -r1.41 SwingUtilities.java
--- javax/swing/SwingUtilities.java 19 Jan 2006 21:25:22 -0000 1.41
+++ javax/swing/SwingUtilities.java 19 Jan 2006 22:21:51 -0000
@@ -1021,9 +1021,9 @@
*
* @return The common Frame
*/
- static Frame getOwnerFrame(Frame owner)
+ static Window getOwnerFrame(Window owner)
{
- Frame result = owner;
+ Window result = owner;
if (result == null)
{
if (ownerFrame == null)
Index: javax/swing/JDialog.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JDialog.java,v
retrieving revision 1.20
diff -u -r1.20 JDialog.java
--- javax/swing/JDialog.java 19 Jan 2006 21:25:22 -0000 1.20
+++ javax/swing/JDialog.java 19 Jan 2006 22:21:51 -0000
@@ -107,7 +107,7 @@
*/
public JDialog()
{
- this(SwingUtilities.getOwnerFrame(null), "", false, null);
+ this((Frame) SwingUtilities.getOwnerFrame(null), "", false, null);
}
/**
@@ -234,7 +234,7 @@
public JDialog(Frame owner, String title, boolean modal,
GraphicsConfiguration gc)
{
- super(SwingUtilities.getOwnerFrame(owner), title, modal, gc);
+ super((Frame) SwingUtilities.getOwnerFrame(owner), title, modal, gc);
dialogInit();
}
Index: javax/swing/JFileChooser.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JFileChooser.java,v
retrieving revision 1.26
diff -u -r1.26 JFileChooser.java
--- javax/swing/JFileChooser.java 19 Jan 2006 21:25:22 -0000 1.26
+++ javax/swing/JFileChooser.java 19 Jan 2006 22:21:52 -0000
@@ -725,7 +725,7 @@
{
Frame toUse = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, parent);
if (toUse == null)
- toUse = SwingUtilities.getOwnerFrame(null);
+ toUse = (Frame) SwingUtilities.getOwnerFrame(null);
JDialog dialog = new JDialog(toUse);
setSelectedFile(null);
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches