From 3578dcd843cab3e2a58dc6bc13e96f048eedc08a Mon Sep 17 00:00:00 2001 From: mkoch Date: Tue, 14 Jan 2003 21:21:35 +0000 Subject: 2003-01-14 Michael Koch * java/awt/Label.java (Label): Implements javax.accessibility.Accessible; * java/awt/List.java (List): Implements javax.accessibility.Accessible; * java/awt/ScrollPane.java (ScrollPane): Implements javax.accessibility.Accessible; * java/awt/Scrollbar.java (Scrollbar): Implements javax.accessibility.Accessible; * java/awt/TextComponent.java (setCaretPosition): Throw exception, documentation added. * java/awt/Toolkit.java: Added some newlines in method documentations. (createButton): Exception documentation added. (createTextField): Exception documentation added. (createLabel): Exception documentation added. (createList): Exception documentation added. (createCheckbox): Exception documentation added. (createScrollbar): Exception documentation added. (createScrollPane): Exception documentation added. (createTextArea): Exception documentation added. (createChoice): Exception documentation added. (createFrame): Exception documentation added. (createWindow): Exception documentation added. (createDialog): Exception documentation added. (createMenuBar): Exception documentation added. (createMenu): Exception documentation added. (createMenuItem): Exception documentation added. (createFileDialog): Exception documentation added. (createCheckboxMenuItem): Exception documentation added. (loadSystemColors): Exception documentation added. (setDynamicLayout): Exception documentation added. (isDynamicLayoutSet): Exception documentation added. (isDynamicLayoutActive): Exception documentation added. (getScreenSize): Exception documentation added. (getScreenResolution): Exception documentation added. (getScreenInsets): Exception documentation added. (getColorModel): Exception documentation added. (getSystemClipboard): Exception documentation added. (getSystemSelection): Exception documentation added. (getMenuShortcutKeyMask): Exception documentation added. (getSystemEventQueue): Exception documentation added. * java/awt/Window.java: Reindented some code. (Window): Centralized implementation, documentation added. (finalize): Documentation added. (hide): Fixed typo in comment. (getWindowListeners): Documentation added. * java/awt/color/ColorSpace.java (toRGB): Documentation added. * java/awt/color/ICC_ColorSpace.java (ICC_ColorSpace): Documentation added. (toRGB): Throw exception, documentation added. (fromRGB): Throw exception, documentation added. (toCIEXYZ): Documentation added. (fromCIEXYZ): Documentation added. (getMinValue): Documentation added. (getMaxValue): Documentation added. * java/awt/geom/Dimension2D.java (clone): Documentation added. * java/awt/geom/GeneralPath.java (clone): Documentation added. * java/awt/geom/Line2D.java (clone): Documentation added. * java/awt/geom/QuadCurve2D.java (clone): Documentation added. * java/awt/image/ColorModel.java (ColorModel): Throw exception, documentation added. * java/awt/image/ImageFilter.java (clone): Doesnt throw CloneNotSupportedException. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61303 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/awt/Window.java | 95 ++++++++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 26 deletions(-) (limited to 'libjava/java/awt/Window.java') diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java index b8befaf0507..31e6b573f53 100644 --- a/libjava/java/awt/Window.java +++ b/libjava/java/awt/Window.java @@ -86,32 +86,56 @@ public class Window extends Container * parent. The window will initially be invisible. * * @param parent The owning Frame of this window. + * + * @exception IllegalArgumentException If the owner's GraphicsConfiguration + * is not from a screen device, or if owner is null; this exception is always + * thrown when GraphicsEnvironment.isHeadless returns true. */ public Window(Frame owner) { - this((Window) owner); + this (owner, owner.getGraphicsConfiguration ()); } - /** @since 1.2 */ + /** + * Initializes a new instance of Window with the specified + * parent. The window will initially be invisible. + * + * @exception IllegalArgumentException If the owner's GraphicsConfiguration + * is not from a screen device, or if owner is null; this exception is always + * thrown when GraphicsEnvironment.isHeadless returns true. + * + * @since 1.2 + */ public Window(Window owner) { - this(); - if (owner == null) - throw new IllegalArgumentException("owner must not be null"); - - this.parent = owner; - - // FIXME: add to owner's "owned window" list - //owner.owned.add(this); // this should be a weak reference + this (owner, owner.getGraphicsConfiguration ()); } - /** @since 1.3 */ + /** + * Initializes a new instance of Window with the specified + * parent. The window will initially be invisible. + * + * @exception IllegalArgumentException If owner is null or if gc is not from a + * screen device; this exception is always thrown when + * GraphicsEnvironment.isHeadless returns true. + * + * @since 1.3 + */ public Window(Window owner, GraphicsConfiguration gc) { - this(owner); + this (); + + if (owner == null) + throw new IllegalArgumentException ("owner must not be null"); + this.parent = owner; + + // FIXME: add to owner's "owned window" list + //owner.owned.add(this); // this should be a weak reference + /* FIXME: Security check SecurityManager.checkTopLevelWindow(...) + */ if (gc != null && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN) @@ -119,11 +143,10 @@ public class Window extends Container if (gc == null) graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment() - .getDefaultScreenDevice() - .getDefaultConfiguration(); + .getDefaultScreenDevice() + .getDefaultConfiguration(); else - */ - graphicsConfiguration = gc; + graphicsConfiguration = gc; } GraphicsConfiguration getGraphicsConfigurationImpl() @@ -134,6 +157,12 @@ public class Window extends Container return super.getGraphicsConfigurationImpl(); } + /** + * Disposes of the input methods and context, and removes the WeakReference + * which formerly pointed to this Window from the parent's owned Window list. + * + * @exception Throwable The Exception raised by this method. + */ protected void finalize() throws Throwable { // FIXME: remove from owner's "owned window" list (Weak References) @@ -185,7 +214,7 @@ public class Window extends Container public void hide() { - // FIXME: call hide() on amy "owned" children here. + // FIXME: call hide() on any "owned" children here. super.hide(); } @@ -233,8 +262,8 @@ public class Window extends Container { if (peer != null) { - WindowPeer wp = (WindowPeer) peer; - wp.toFront(); + WindowPeer wp = (WindowPeer) peer; + wp.toFront(); } } @@ -265,12 +294,12 @@ public class Window extends Container if (!secure) { if (warningString != null) - return warningString; - else - { - String warning = System.getProperty("awt.appletWarning"); - return warning; - } + return warningString; + else + { + String warning = System.getProperty("awt.appletWarning"); + return warning; + } } return null; } @@ -338,6 +367,11 @@ public class Window extends Container windowListener = AWTEventMulticaster.remove(windowListener, listener); } + /** + * Returns an array of all the window listeners registered on this window. + * + * @since 1.4 + */ public synchronized WindowListener[] getWindowListeners() { return (WindowListener[]) @@ -345,7 +379,16 @@ public class Window extends Container WindowListener.class); } - /** @since 1.3 */ + /** + * Returns an array of all the objects currently registered as FooListeners + * upon this Window. FooListeners are registered using the addFooListener + * method. + * + * @exception ClassCastException If listenerType doesn't specify a class or + * interface that implements java.util.EventListener. + * + * @since 1.3 + */ public EventListener[] getListeners(Class listenerType) { if (listenerType == WindowListener.class) -- cgit v1.2.3