diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-14 21:21:35 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-14 21:21:35 +0000 |
commit | 3578dcd843cab3e2a58dc6bc13e96f048eedc08a (patch) | |
tree | 666ba25bc24bce17d8c08205797a7aef5d4d6f24 | |
parent | 29ad7ff6a90831166cb1825b91a570baa0119e86 (diff) | |
download | ppe42-gcc-3578dcd843cab3e2a58dc6bc13e96f048eedc08a.tar.gz ppe42-gcc-3578dcd843cab3e2a58dc6bc13e96f048eedc08a.zip |
2003-01-14 Michael Koch <konqueror@gmx.de>
* 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
-rw-r--r-- | libjava/ChangeLog | 72 | ||||
-rw-r--r-- | libjava/java/awt/Label.java | 4 | ||||
-rw-r--r-- | libjava/java/awt/List.java | 4 | ||||
-rw-r--r-- | libjava/java/awt/ScrollPane.java | 4 | ||||
-rw-r--r-- | libjava/java/awt/Scrollbar.java | 7 | ||||
-rw-r--r-- | libjava/java/awt/TextComponent.java | 8 | ||||
-rw-r--r-- | libjava/java/awt/Toolkit.java | 64 | ||||
-rw-r--r-- | libjava/java/awt/Window.java | 95 | ||||
-rw-r--r-- | libjava/java/awt/color/ColorSpace.java | 7 | ||||
-rw-r--r-- | libjava/java/awt/color/ICC_ColorSpace.java | 33 | ||||
-rw-r--r-- | libjava/java/awt/geom/Dimension2D.java | 5 | ||||
-rw-r--r-- | libjava/java/awt/geom/GeneralPath.java | 4 | ||||
-rw-r--r-- | libjava/java/awt/geom/Line2D.java | 4 | ||||
-rw-r--r-- | libjava/java/awt/geom/QuadCurve2D.java | 4 | ||||
-rw-r--r-- | libjava/java/awt/image/ColorModel.java | 22 | ||||
-rw-r--r-- | libjava/java/awt/image/ImageFilter.java | 13 |
16 files changed, 317 insertions, 33 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 43897310dc1..49de829240f 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,75 @@ +2003-01-14 Michael Koch <konqueror@gmx.de> + + * 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. + 2003-01-14 Andrew Haley <aph@redhat.com> * java/lang/natRuntime.cc (_load): StackTrace access needs to be diff --git a/libjava/java/awt/Label.java b/libjava/java/awt/Label.java index b029b2a3cd5..4f248c30bb9 100644 --- a/libjava/java/awt/Label.java +++ b/libjava/java/awt/Label.java @@ -40,6 +40,8 @@ package java.awt; import java.awt.peer.LabelPeer; import java.awt.peer.ComponentPeer; +import java.io.Serializable; +import javax.accessibility.Accessible; /** * This component is used for displaying simple text strings that cannot @@ -48,7 +50,7 @@ import java.awt.peer.ComponentPeer; * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey <tromey@cygnus.com> */ -public class Label extends Component implements java.io.Serializable +public class Label extends Component implements Serializable, Accessible { /* diff --git a/libjava/java/awt/List.java b/libjava/java/awt/List.java index 07fea67b022..561a30d4dab 100644 --- a/libjava/java/awt/List.java +++ b/libjava/java/awt/List.java @@ -46,13 +46,15 @@ import java.awt.event.ItemListener; import java.awt.peer.ListPeer; import java.awt.peer.ComponentPeer; import java.util.Vector; +import javax.accessibility.Accessible; /** * Class that implements a listbox widget * * @author Aaron M. Renn (arenn@urbanophile.com) */ -public class List extends Component implements ItemSelectable, Serializable +public class List extends Component + implements ItemSelectable, Serializable, Accessible { /* diff --git a/libjava/java/awt/ScrollPane.java b/libjava/java/awt/ScrollPane.java index 0c9354b2887..045600cddf2 100644 --- a/libjava/java/awt/ScrollPane.java +++ b/libjava/java/awt/ScrollPane.java @@ -41,6 +41,8 @@ package java.awt; import java.awt.peer.ScrollPanePeer; import java.awt.peer.ContainerPeer; import java.awt.peer.ComponentPeer; +import java.io.Serializable; +import javax.accessibility.Accessible; /** * This widget provides a scrollable region that allows a single @@ -48,7 +50,7 @@ import java.awt.peer.ComponentPeer; * * @author Aaron M. Renn (arenn@urbanophile.com) */ -public class ScrollPane extends Container implements java.io.Serializable +public class ScrollPane extends Container implements Accessible, Serializable { /* diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java index db4a3fcd2dc..4bdc3166ad9 100644 --- a/libjava/java/awt/Scrollbar.java +++ b/libjava/java/awt/Scrollbar.java @@ -42,6 +42,8 @@ import java.awt.peer.ScrollbarPeer; import java.awt.peer.ComponentPeer; import java.awt.event.AdjustmentListener; import java.awt.event.AdjustmentEvent; +import java.io.Serializable; +import javax.accessibility.Accessible; /** * This class implements a scrollbar widget. @@ -49,8 +51,9 @@ import java.awt.event.AdjustmentEvent; * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey <tromey@cygnus.com> */ -public class Scrollbar extends Component implements Adjustable, - java.io.Serializable +public class Scrollbar extends Component implements Accessible, + Adjustable, + Serializable { // FIXME: Serialization readObject/writeObject diff --git a/libjava/java/awt/TextComponent.java b/libjava/java/awt/TextComponent.java index 5ba80edc1da..6dc904cc8b1 100644 --- a/libjava/java/awt/TextComponent.java +++ b/libjava/java/awt/TextComponent.java @@ -291,10 +291,18 @@ getCaretPosition() * Sets the caret position to the specified value. * * @param caretPosition The new caret position. + * + * @exception IllegalArgumentException If the value supplied for position + * is less than zero. + * + * @since 1.1 */ public synchronized void setCaretPosition(int caretPosition) { + if (caretPosition < 0) + throw new IllegalArgumentException (); + TextComponentPeer tcp = (TextComponentPeer)getPeer(); if (tcp != null) tcp.setCaretPosition(caretPosition); diff --git a/libjava/java/awt/Toolkit.java b/libjava/java/awt/Toolkit.java index fb5e020a29e..da9bc0e4e4b 100644 --- a/libjava/java/awt/Toolkit.java +++ b/libjava/java/awt/Toolkit.java @@ -123,7 +123,10 @@ public abstract class Toolkit * Creates a peer object for the specified <code>Button</code>. * * @param target The <code>Button</code> to create the peer for. + * * @return The peer for the specified <code>Button</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract ButtonPeer createButton(Button target); @@ -132,6 +135,8 @@ public abstract class Toolkit * * @param target The <code>TextField</code> to create the peer for. * @return The peer for the specified <code>TextField</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract TextFieldPeer createTextField(TextField target); @@ -140,6 +145,8 @@ public abstract class Toolkit * * @param target The <code>Label</code> to create the peer for. * @return The peer for the specified <code>Label</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract LabelPeer createLabel(Label target); @@ -148,6 +155,8 @@ public abstract class Toolkit * * @param target The <code>List</code> to create the peer for. * @return The peer for the specified <code>List</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract ListPeer createList(List target); @@ -156,6 +165,8 @@ public abstract class Toolkit * * @param target The <code>Checkbox</code> to create the peer for. * @return The peer for the specified <code>Checkbox</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract CheckboxPeer createCheckbox(Checkbox target); @@ -164,6 +175,8 @@ public abstract class Toolkit * * @param target The <code>Scrollbar</code> to create the peer for. * @return The peer for the specified <code>Scrollbar</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract ScrollbarPeer createScrollbar(Scrollbar target); @@ -172,6 +185,8 @@ public abstract class Toolkit * * @param target The <code>ScrollPane</code> to create the peer for. * @return The peer for the specified <code>ScrollPane</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract ScrollPanePeer createScrollPane(ScrollPane target); @@ -180,6 +195,8 @@ public abstract class Toolkit * * @param target The <code>TextArea</code> to create the peer for. * @return The peer for the specified <code>TextArea</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract TextAreaPeer createTextArea(TextArea target); @@ -188,6 +205,8 @@ public abstract class Toolkit * * @param target The <code>Choice</code> to create the peer for. * @return The peer for the specified <code>Choice</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract ChoicePeer createChoice(Choice target); @@ -196,6 +215,8 @@ public abstract class Toolkit * * @param target The <code>Frame</code> to create the peer for. * @return The peer for the specified <code>Frame</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract FramePeer createFrame(Frame target); @@ -220,6 +241,8 @@ public abstract class Toolkit * * @param target The <code>Window</code> to create the peer for. * @return The peer for the specified <code>Window</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract WindowPeer createWindow(Window target); @@ -228,6 +251,8 @@ public abstract class Toolkit * * @param target The dialog to create the peer for * @return The peer for the specified font name. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract DialogPeer createDialog(Dialog target); @@ -236,6 +261,8 @@ public abstract class Toolkit * * @param target The <code>MenuBar</code> to create the peer for. * @return The peer for the specified <code>MenuBar</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract MenuBarPeer createMenuBar(MenuBar target); @@ -244,6 +271,8 @@ public abstract class Toolkit * * @param target The <code>Menu</code> to create the peer for. * @return The peer for the specified <code>Menu</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract MenuPeer createMenu(Menu target); @@ -252,6 +281,8 @@ public abstract class Toolkit * * @param target The <code>PopupMenu</code> to create the peer for. * @return The peer for the specified <code>PopupMenu</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract PopupMenuPeer createPopupMenu(PopupMenu target); @@ -260,6 +291,8 @@ public abstract class Toolkit * * @param target The <code>MenuItem</code> to create the peer for. * @return The peer for the specified <code>MenuItem</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract MenuItemPeer createMenuItem(MenuItem target); @@ -268,6 +301,8 @@ public abstract class Toolkit * * @param target The <code>FileDialog</code> to create the peer for. * @return The peer for the specified <code>FileDialog</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract FileDialogPeer createFileDialog(FileDialog target); @@ -276,6 +311,8 @@ public abstract class Toolkit * * @param target The <code>CheckboxMenuItem</code> to create the peer for. * @return The peer for the specified <code>CheckboxMenuItem</code> object. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected abstract CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target); @@ -310,6 +347,8 @@ public abstract class Toolkit * the interface used by the <code>SystemColors</code> class. * * @param colors The array to copy the system colors into. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected void loadSystemColors(int systemColors[]) { @@ -318,6 +357,8 @@ public abstract class Toolkit /** * @since 1.4 + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public void setDynamicLayout(boolean dynamic) { @@ -325,6 +366,8 @@ public abstract class Toolkit /** * @since 1.4 + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected boolean isDynamicLayoutSet() { @@ -333,6 +376,8 @@ public abstract class Toolkit /** * @since 1.4 + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public boolean isDynamicLayoutActive() { @@ -343,6 +388,8 @@ public abstract class Toolkit * Returns the dimensions of the screen in pixels. * * @return The dimensions of the screen in pixels. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public abstract Dimension getScreenSize(); @@ -350,10 +397,14 @@ public abstract class Toolkit * Returns the screen resolution in dots per square inch. * * @return The screen resolution in dots per square inch. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public abstract int getScreenResolution(); /** + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. + * * @since 1.4 */ public Insets getScreenInsets(GraphicsConfiguration gc) @@ -396,6 +447,7 @@ public abstract class Toolkit * if the property is not set. * * @return An instance of the system default toolkit. + * * @throws AWTError If the toolkit cannot be loaded. */ public static Toolkit getDefaultToolkit() @@ -450,6 +502,7 @@ public abstract class Toolkit * @param height The height of the image. * @param observer The observer to receive events about the preparation * process. + * * @return <code>true</code> if the image is already prepared for rendering, * <code>false</code> otherwise. */ @@ -465,6 +518,7 @@ public abstract class Toolkit * @param height The height of the image. * @param observer The observer to receive events about the preparation * process. + * * @return A union of the bitmasks from * <code>java.awt.image.ImageObserver</code> that indicates the current * state of the imaging readying process. @@ -476,6 +530,7 @@ public abstract class Toolkit * Creates an image using the specified <code>ImageProducer</code> * * @param producer The <code>ImageProducer</code> to create the image from. + * * @return The created image. */ public abstract Image createImage(ImageProducer producer); @@ -485,6 +540,7 @@ public abstract class Toolkit * a recognized format. Supported formats vary from toolkit to toolkit. * * @param data The raw image data. + * * @return The created image. */ public Image createImage(byte[] data) @@ -500,6 +556,7 @@ public abstract class Toolkit * @param data The raw image data. * @param offset The offset into the data where the image data starts. * @param len The length of the image data. + * * @return The created image. */ public abstract Image createImage(byte[] data, int offset, int len); @@ -511,6 +568,7 @@ public abstract class Toolkit * @param frame The window initiating the print job. * @param title The print job title. * @param props The print job properties. + * * @return The requested print job, or <code>null</code> if the job * was cancelled. */ @@ -536,10 +594,14 @@ public abstract class Toolkit * Returns the system clipboard. * * @return THe system clipboard. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public abstract Clipboard getSystemClipboard(); /** + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. + * * @since 1.4 */ public Clipboard getSystemSelection() @@ -553,6 +615,8 @@ public abstract class Toolkit * to change the default. * * @return The key mask for the menu accelerator key. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public int getMenuShortcutKeyMask() { 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 <code>Frame</code> 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 <code>Window</code> 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 <code>Window</code> 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) diff --git a/libjava/java/awt/color/ColorSpace.java b/libjava/java/awt/color/ColorSpace.java index 9be70cb38a9..8bf0a8196c0 100644 --- a/libjava/java/awt/color/ColorSpace.java +++ b/libjava/java/awt/color/ColorSpace.java @@ -131,6 +131,13 @@ public abstract class ColorSpace implements Serializable return false; } + /** + * Transforms a color value assumed to be in this ColorSpace into a value in + * the default CS_sRGB color space. + * + * @exception ArrayIndexOutOfBoundsException If array length is not at least + * the number of components in this ColorSpace. + */ public abstract float[] toRGB(float[] colorvalue); public abstract float[] fromRGB(float[] rgbvalue); diff --git a/libjava/java/awt/color/ICC_ColorSpace.java b/libjava/java/awt/color/ICC_ColorSpace.java index 1a144dbfbd2..2b7016742c9 100644 --- a/libjava/java/awt/color/ICC_ColorSpace.java +++ b/libjava/java/awt/color/ICC_ColorSpace.java @@ -81,6 +81,12 @@ public class ICC_ColorSpace extends ColorSpace */ private boolean needScaleInit; + /** + * Constructs a new ICC_ColorSpace from an ICC_Profile object. + * + * @exception IllegalArgumentException If profile is inappropriate for + * representing a ColorSpace. + */ public ICC_ColorSpace(ICC_Profile profile) { super(CS_sRGB, profile.getNumComponents()); @@ -92,18 +98,45 @@ public class ICC_ColorSpace extends ColorSpace return thisProfile; } + /** + * Transforms a color value assumed to be in this ColorSpace into a value in + * the default CS_sRGB color space. + * + * @exception ArrayIndexOutOfBoundsException If array length is not at least + * the number of components in this ColorSpace. + */ public float[] toRGB(float[] colorvalue) { + if (colorvalue.length < numComponents) + throw new IllegalArgumentException (); + // FIXME: Always assumes sRGB: return colorvalue; } + /** + * Transforms a color value assumed to be in the default CS_sRGB color space + * into this ColorSpace. + * + * @exception ArrayIndexOutOfBoundsException If array length is not at + * least 3. + */ public float[] fromRGB(float[] rgbvalue) { + if (rgbvalue.length < 3) + throw new IllegalArgumentException (); + // FIXME: Always assumes sRGB: return rgbvalue; } + /** + * Transforms a color value assumed to be in this ColorSpace into the + * CS_CIEXYZ conversion color space. + * + * @exception ArrayIndexOutOfBoundsException If array length is not at + * least the number of components in this ColorSpace. + */ public float[] toCIEXYZ(float[] colorvalue) { // FIXME: Not implemented diff --git a/libjava/java/awt/geom/Dimension2D.java b/libjava/java/awt/geom/Dimension2D.java index e111e5434cf..dbbdf6b25b3 100644 --- a/libjava/java/awt/geom/Dimension2D.java +++ b/libjava/java/awt/geom/Dimension2D.java @@ -86,6 +86,7 @@ public abstract class Dimension2D implements Cloneable * may occur. * * @param d the dimension containing the new values + * * @throws NullPointerException if d is null */ public void setSize(Dimension2D d) @@ -98,6 +99,10 @@ public abstract class Dimension2D implements Cloneable * as this one. * * @return the clone + * + * @exception OutOfMemoryError If there is not enough memory available. + * + * @since 1.2 */ public Object clone() { diff --git a/libjava/java/awt/geom/GeneralPath.java b/libjava/java/awt/geom/GeneralPath.java index 267db6ca0e3..6c1b578fc19 100644 --- a/libjava/java/awt/geom/GeneralPath.java +++ b/libjava/java/awt/geom/GeneralPath.java @@ -338,6 +338,10 @@ public final class GeneralPath implements Shape, Cloneable * this one. * * @return the clone + * + * @exception OutOfMemoryError If there is not enough memory available. + * + * @since 1.2 */ public Object clone() { diff --git a/libjava/java/awt/geom/Line2D.java b/libjava/java/awt/geom/Line2D.java index 9e551103332..d2dd65c4341 100644 --- a/libjava/java/awt/geom/Line2D.java +++ b/libjava/java/awt/geom/Line2D.java @@ -752,6 +752,10 @@ public abstract class Line2D implements Shape, Cloneable * this one. * * @return the clone + * + * @exception OutOfMemoryError If there is not enough memory available. + * + * @since 1.2 */ public Object clone() { diff --git a/libjava/java/awt/geom/QuadCurve2D.java b/libjava/java/awt/geom/QuadCurve2D.java index 2f1aafad21b..05748fc979d 100644 --- a/libjava/java/awt/geom/QuadCurve2D.java +++ b/libjava/java/awt/geom/QuadCurve2D.java @@ -289,6 +289,10 @@ public abstract class QuadCurve2D implements Shape, Cloneable * this one. * * @return the clone + * + * @exception OutOfMemoryError If there is not enough memory available. + * + * @since 1.2 */ public Object clone() { diff --git a/libjava/java/awt/image/ColorModel.java b/libjava/java/awt/image/ColorModel.java index 14a1b2e73b9..fab51667edb 100644 --- a/libjava/java/awt/image/ColorModel.java +++ b/libjava/java/awt/image/ColorModel.java @@ -120,10 +120,32 @@ public abstract class ColorModel implements Transparency Buffers.smallestAppropriateTransferType(bits * 4)); } + /** + * Constructs a ColorModel that translates pixel values to + * color/alpha components. + * + * @exception IllegalArgumentException If the length of the bit array is less + * than the number of color or alpha components in this ColorModel, or if the + * transparency is not a valid value, or if the sum of the number of bits in + * bits is less than 1 or if any of the elements in bits is less than 0. + */ protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType) { + int bits_sum = 0; + for (int i = 0; i < bits.length; i++) + { + if (bits [i] < 0) + throw new IllegalArgumentException (); + + bits_sum |= bits [i]; + } + + if ((bits.length < cspace.numComponents) + || (bits_sum < 1)) + throw new IllegalArgumentException (); + this.pixel_bits = pixel_bits; this.bits = bits; this.cspace = cspace; diff --git a/libjava/java/awt/image/ImageFilter.java b/libjava/java/awt/image/ImageFilter.java index b34bb7d9cd3..86bc0210a4b 100644 --- a/libjava/java/awt/image/ImageFilter.java +++ b/libjava/java/awt/image/ImageFilter.java @@ -81,9 +81,18 @@ public class ImageFilter implements ImageConsumer, Cloneable * * @see java.lang.Object#clone () */ - public Object clone() throws CloneNotSupportedException + public Object clone() { - return (super.clone()); + try + { + return super.clone(); + } + catch (CloneNotSupportedException e) + { + // This should never happen as this class implements the + // Cloneable interface. + throw new InternalError (); + } } /** |