Commit 7365ecf7 by Michael Koch Committed by Michael Koch

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.

From-SVN: r61303
parent b41621ee
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> 2003-01-14 Andrew Haley <aph@redhat.com>
* java/lang/natRuntime.cc (_load): StackTrace access needs to be * java/lang/natRuntime.cc (_load): StackTrace access needs to be
......
...@@ -40,6 +40,8 @@ package java.awt; ...@@ -40,6 +40,8 @@ package java.awt;
import java.awt.peer.LabelPeer; import java.awt.peer.LabelPeer;
import java.awt.peer.ComponentPeer; import java.awt.peer.ComponentPeer;
import java.io.Serializable;
import javax.accessibility.Accessible;
/** /**
* This component is used for displaying simple text strings that cannot * This component is used for displaying simple text strings that cannot
...@@ -48,7 +50,7 @@ import java.awt.peer.ComponentPeer; ...@@ -48,7 +50,7 @@ import java.awt.peer.ComponentPeer;
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey <tromey@cygnus.com> * @author Tom Tromey <tromey@cygnus.com>
*/ */
public class Label extends Component implements java.io.Serializable public class Label extends Component implements Serializable, Accessible
{ {
/* /*
......
...@@ -46,13 +46,15 @@ import java.awt.event.ItemListener; ...@@ -46,13 +46,15 @@ import java.awt.event.ItemListener;
import java.awt.peer.ListPeer; import java.awt.peer.ListPeer;
import java.awt.peer.ComponentPeer; import java.awt.peer.ComponentPeer;
import java.util.Vector; import java.util.Vector;
import javax.accessibility.Accessible;
/** /**
* Class that implements a listbox widget * Class that implements a listbox widget
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public class List extends Component implements ItemSelectable, Serializable public class List extends Component
implements ItemSelectable, Serializable, Accessible
{ {
/* /*
......
...@@ -41,6 +41,8 @@ package java.awt; ...@@ -41,6 +41,8 @@ package java.awt;
import java.awt.peer.ScrollPanePeer; import java.awt.peer.ScrollPanePeer;
import java.awt.peer.ContainerPeer; import java.awt.peer.ContainerPeer;
import java.awt.peer.ComponentPeer; import java.awt.peer.ComponentPeer;
import java.io.Serializable;
import javax.accessibility.Accessible;
/** /**
* This widget provides a scrollable region that allows a single * This widget provides a scrollable region that allows a single
...@@ -48,7 +50,7 @@ import java.awt.peer.ComponentPeer; ...@@ -48,7 +50,7 @@ import java.awt.peer.ComponentPeer;
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public class ScrollPane extends Container implements java.io.Serializable public class ScrollPane extends Container implements Accessible, Serializable
{ {
/* /*
......
...@@ -42,6 +42,8 @@ import java.awt.peer.ScrollbarPeer; ...@@ -42,6 +42,8 @@ import java.awt.peer.ScrollbarPeer;
import java.awt.peer.ComponentPeer; import java.awt.peer.ComponentPeer;
import java.awt.event.AdjustmentListener; import java.awt.event.AdjustmentListener;
import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentEvent;
import java.io.Serializable;
import javax.accessibility.Accessible;
/** /**
* This class implements a scrollbar widget. * This class implements a scrollbar widget.
...@@ -49,8 +51,9 @@ import java.awt.event.AdjustmentEvent; ...@@ -49,8 +51,9 @@ import java.awt.event.AdjustmentEvent;
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey <tromey@cygnus.com> * @author Tom Tromey <tromey@cygnus.com>
*/ */
public class Scrollbar extends Component implements Adjustable, public class Scrollbar extends Component implements Accessible,
java.io.Serializable Adjustable,
Serializable
{ {
// FIXME: Serialization readObject/writeObject // FIXME: Serialization readObject/writeObject
......
...@@ -291,10 +291,18 @@ getCaretPosition() ...@@ -291,10 +291,18 @@ getCaretPosition()
* Sets the caret position to the specified value. * Sets the caret position to the specified value.
* *
* @param caretPosition The new caret position. * @param caretPosition The new caret position.
*
* @exception IllegalArgumentException If the value supplied for position
* is less than zero.
*
* @since 1.1
*/ */
public synchronized void public synchronized void
setCaretPosition(int caretPosition) setCaretPosition(int caretPosition)
{ {
if (caretPosition < 0)
throw new IllegalArgumentException ();
TextComponentPeer tcp = (TextComponentPeer)getPeer(); TextComponentPeer tcp = (TextComponentPeer)getPeer();
if (tcp != null) if (tcp != null)
tcp.setCaretPosition(caretPosition); tcp.setCaretPosition(caretPosition);
......
...@@ -123,7 +123,10 @@ public abstract class Toolkit ...@@ -123,7 +123,10 @@ public abstract class Toolkit
* Creates a peer object for the specified <code>Button</code>. * Creates a peer object for the specified <code>Button</code>.
* *
* @param target The <code>Button</code> to create the peer for. * @param target The <code>Button</code> to create the peer for.
*
* @return The peer for the specified <code>Button</code> object. * @return The peer for the specified <code>Button</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract ButtonPeer createButton(Button target); protected abstract ButtonPeer createButton(Button target);
...@@ -132,6 +135,8 @@ public abstract class Toolkit ...@@ -132,6 +135,8 @@ public abstract class Toolkit
* *
* @param target The <code>TextField</code> to create the peer for. * @param target The <code>TextField</code> to create the peer for.
* @return The peer for the specified <code>TextField</code> object. * @return The peer for the specified <code>TextField</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract TextFieldPeer createTextField(TextField target); protected abstract TextFieldPeer createTextField(TextField target);
...@@ -140,6 +145,8 @@ public abstract class Toolkit ...@@ -140,6 +145,8 @@ public abstract class Toolkit
* *
* @param target The <code>Label</code> to create the peer for. * @param target The <code>Label</code> to create the peer for.
* @return The peer for the specified <code>Label</code> object. * @return The peer for the specified <code>Label</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract LabelPeer createLabel(Label target); protected abstract LabelPeer createLabel(Label target);
...@@ -148,6 +155,8 @@ public abstract class Toolkit ...@@ -148,6 +155,8 @@ public abstract class Toolkit
* *
* @param target The <code>List</code> to create the peer for. * @param target The <code>List</code> to create the peer for.
* @return The peer for the specified <code>List</code> object. * @return The peer for the specified <code>List</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract ListPeer createList(List target); protected abstract ListPeer createList(List target);
...@@ -156,6 +165,8 @@ public abstract class Toolkit ...@@ -156,6 +165,8 @@ public abstract class Toolkit
* *
* @param target The <code>Checkbox</code> to create the peer for. * @param target The <code>Checkbox</code> to create the peer for.
* @return The peer for the specified <code>Checkbox</code> object. * @return The peer for the specified <code>Checkbox</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract CheckboxPeer createCheckbox(Checkbox target); protected abstract CheckboxPeer createCheckbox(Checkbox target);
...@@ -164,6 +175,8 @@ public abstract class Toolkit ...@@ -164,6 +175,8 @@ public abstract class Toolkit
* *
* @param target The <code>Scrollbar</code> to create the peer for. * @param target The <code>Scrollbar</code> to create the peer for.
* @return The peer for the specified <code>Scrollbar</code> object. * @return The peer for the specified <code>Scrollbar</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract ScrollbarPeer createScrollbar(Scrollbar target); protected abstract ScrollbarPeer createScrollbar(Scrollbar target);
...@@ -172,6 +185,8 @@ public abstract class Toolkit ...@@ -172,6 +185,8 @@ public abstract class Toolkit
* *
* @param target The <code>ScrollPane</code> to create the peer for. * @param target The <code>ScrollPane</code> to create the peer for.
* @return The peer for the specified <code>ScrollPane</code> object. * @return The peer for the specified <code>ScrollPane</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract ScrollPanePeer createScrollPane(ScrollPane target); protected abstract ScrollPanePeer createScrollPane(ScrollPane target);
...@@ -180,6 +195,8 @@ public abstract class Toolkit ...@@ -180,6 +195,8 @@ public abstract class Toolkit
* *
* @param target The <code>TextArea</code> to create the peer for. * @param target The <code>TextArea</code> to create the peer for.
* @return The peer for the specified <code>TextArea</code> object. * @return The peer for the specified <code>TextArea</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract TextAreaPeer createTextArea(TextArea target); protected abstract TextAreaPeer createTextArea(TextArea target);
...@@ -188,6 +205,8 @@ public abstract class Toolkit ...@@ -188,6 +205,8 @@ public abstract class Toolkit
* *
* @param target The <code>Choice</code> to create the peer for. * @param target The <code>Choice</code> to create the peer for.
* @return The peer for the specified <code>Choice</code> object. * @return The peer for the specified <code>Choice</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract ChoicePeer createChoice(Choice target); protected abstract ChoicePeer createChoice(Choice target);
...@@ -196,6 +215,8 @@ public abstract class Toolkit ...@@ -196,6 +215,8 @@ public abstract class Toolkit
* *
* @param target The <code>Frame</code> to create the peer for. * @param target The <code>Frame</code> to create the peer for.
* @return The peer for the specified <code>Frame</code> object. * @return The peer for the specified <code>Frame</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract FramePeer createFrame(Frame target); protected abstract FramePeer createFrame(Frame target);
...@@ -220,6 +241,8 @@ public abstract class Toolkit ...@@ -220,6 +241,8 @@ public abstract class Toolkit
* *
* @param target The <code>Window</code> to create the peer for. * @param target The <code>Window</code> to create the peer for.
* @return The peer for the specified <code>Window</code> object. * @return The peer for the specified <code>Window</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract WindowPeer createWindow(Window target); protected abstract WindowPeer createWindow(Window target);
...@@ -228,6 +251,8 @@ public abstract class Toolkit ...@@ -228,6 +251,8 @@ public abstract class Toolkit
* *
* @param target The dialog to create the peer for * @param target The dialog to create the peer for
* @return The peer for the specified font name. * @return The peer for the specified font name.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract DialogPeer createDialog(Dialog target); protected abstract DialogPeer createDialog(Dialog target);
...@@ -236,6 +261,8 @@ public abstract class Toolkit ...@@ -236,6 +261,8 @@ public abstract class Toolkit
* *
* @param target The <code>MenuBar</code> to create the peer for. * @param target The <code>MenuBar</code> to create the peer for.
* @return The peer for the specified <code>MenuBar</code> object. * @return The peer for the specified <code>MenuBar</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract MenuBarPeer createMenuBar(MenuBar target); protected abstract MenuBarPeer createMenuBar(MenuBar target);
...@@ -244,6 +271,8 @@ public abstract class Toolkit ...@@ -244,6 +271,8 @@ public abstract class Toolkit
* *
* @param target The <code>Menu</code> to create the peer for. * @param target The <code>Menu</code> to create the peer for.
* @return The peer for the specified <code>Menu</code> object. * @return The peer for the specified <code>Menu</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract MenuPeer createMenu(Menu target); protected abstract MenuPeer createMenu(Menu target);
...@@ -252,6 +281,8 @@ public abstract class Toolkit ...@@ -252,6 +281,8 @@ public abstract class Toolkit
* *
* @param target The <code>PopupMenu</code> to create the peer for. * @param target The <code>PopupMenu</code> to create the peer for.
* @return The peer for the specified <code>PopupMenu</code> object. * @return The peer for the specified <code>PopupMenu</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract PopupMenuPeer createPopupMenu(PopupMenu target); protected abstract PopupMenuPeer createPopupMenu(PopupMenu target);
...@@ -260,6 +291,8 @@ public abstract class Toolkit ...@@ -260,6 +291,8 @@ public abstract class Toolkit
* *
* @param target The <code>MenuItem</code> to create the peer for. * @param target The <code>MenuItem</code> to create the peer for.
* @return The peer for the specified <code>MenuItem</code> object. * @return The peer for the specified <code>MenuItem</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract MenuItemPeer createMenuItem(MenuItem target); protected abstract MenuItemPeer createMenuItem(MenuItem target);
...@@ -268,6 +301,8 @@ public abstract class Toolkit ...@@ -268,6 +301,8 @@ public abstract class Toolkit
* *
* @param target The <code>FileDialog</code> to create the peer for. * @param target The <code>FileDialog</code> to create the peer for.
* @return The peer for the specified <code>FileDialog</code> object. * @return The peer for the specified <code>FileDialog</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract FileDialogPeer createFileDialog(FileDialog target); protected abstract FileDialogPeer createFileDialog(FileDialog target);
...@@ -276,6 +311,8 @@ public abstract class Toolkit ...@@ -276,6 +311,8 @@ public abstract class Toolkit
* *
* @param target The <code>CheckboxMenuItem</code> to create the peer for. * @param target The <code>CheckboxMenuItem</code> to create the peer for.
* @return The peer for the specified <code>CheckboxMenuItem</code> object. * @return The peer for the specified <code>CheckboxMenuItem</code> object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected abstract CheckboxMenuItemPeer protected abstract CheckboxMenuItemPeer
createCheckboxMenuItem(CheckboxMenuItem target); createCheckboxMenuItem(CheckboxMenuItem target);
...@@ -310,6 +347,8 @@ public abstract class Toolkit ...@@ -310,6 +347,8 @@ public abstract class Toolkit
* the interface used by the <code>SystemColors</code> class. * the interface used by the <code>SystemColors</code> class.
* *
* @param colors The array to copy the system colors into. * @param colors The array to copy the system colors into.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected void loadSystemColors(int systemColors[]) protected void loadSystemColors(int systemColors[])
{ {
...@@ -318,6 +357,8 @@ public abstract class Toolkit ...@@ -318,6 +357,8 @@ public abstract class Toolkit
/** /**
* @since 1.4 * @since 1.4
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public void setDynamicLayout(boolean dynamic) public void setDynamicLayout(boolean dynamic)
{ {
...@@ -325,6 +366,8 @@ public abstract class Toolkit ...@@ -325,6 +366,8 @@ public abstract class Toolkit
/** /**
* @since 1.4 * @since 1.4
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected boolean isDynamicLayoutSet() protected boolean isDynamicLayoutSet()
{ {
...@@ -333,6 +376,8 @@ public abstract class Toolkit ...@@ -333,6 +376,8 @@ public abstract class Toolkit
/** /**
* @since 1.4 * @since 1.4
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public boolean isDynamicLayoutActive() public boolean isDynamicLayoutActive()
{ {
...@@ -343,6 +388,8 @@ public abstract class Toolkit ...@@ -343,6 +388,8 @@ public abstract class Toolkit
* Returns the dimensions of the screen in pixels. * Returns the dimensions of the screen in pixels.
* *
* @return 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(); public abstract Dimension getScreenSize();
...@@ -350,10 +397,14 @@ public abstract class Toolkit ...@@ -350,10 +397,14 @@ public abstract class Toolkit
* Returns the screen resolution in dots per square inch. * Returns the screen resolution in dots per square inch.
* *
* @return 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(); public abstract int getScreenResolution();
/** /**
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*
* @since 1.4 * @since 1.4
*/ */
public Insets getScreenInsets(GraphicsConfiguration gc) public Insets getScreenInsets(GraphicsConfiguration gc)
...@@ -396,6 +447,7 @@ public abstract class Toolkit ...@@ -396,6 +447,7 @@ public abstract class Toolkit
* if the property is not set. * if the property is not set.
* *
* @return An instance of the system default toolkit. * @return An instance of the system default toolkit.
*
* @throws AWTError If the toolkit cannot be loaded. * @throws AWTError If the toolkit cannot be loaded.
*/ */
public static Toolkit getDefaultToolkit() public static Toolkit getDefaultToolkit()
...@@ -450,6 +502,7 @@ public abstract class Toolkit ...@@ -450,6 +502,7 @@ public abstract class Toolkit
* @param height The height of the image. * @param height The height of the image.
* @param observer The observer to receive events about the preparation * @param observer The observer to receive events about the preparation
* process. * process.
*
* @return <code>true</code> if the image is already prepared for rendering, * @return <code>true</code> if the image is already prepared for rendering,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
...@@ -465,6 +518,7 @@ public abstract class Toolkit ...@@ -465,6 +518,7 @@ public abstract class Toolkit
* @param height The height of the image. * @param height The height of the image.
* @param observer The observer to receive events about the preparation * @param observer The observer to receive events about the preparation
* process. * process.
*
* @return A union of the bitmasks from * @return A union of the bitmasks from
* <code>java.awt.image.ImageObserver</code> that indicates the current * <code>java.awt.image.ImageObserver</code> that indicates the current
* state of the imaging readying process. * state of the imaging readying process.
...@@ -476,6 +530,7 @@ public abstract class Toolkit ...@@ -476,6 +530,7 @@ public abstract class Toolkit
* Creates an image using the specified <code>ImageProducer</code> * Creates an image using the specified <code>ImageProducer</code>
* *
* @param producer The <code>ImageProducer</code> to create the image from. * @param producer The <code>ImageProducer</code> to create the image from.
*
* @return The created image. * @return The created image.
*/ */
public abstract Image createImage(ImageProducer producer); public abstract Image createImage(ImageProducer producer);
...@@ -485,6 +540,7 @@ public abstract class Toolkit ...@@ -485,6 +540,7 @@ public abstract class Toolkit
* a recognized format. Supported formats vary from toolkit to toolkit. * a recognized format. Supported formats vary from toolkit to toolkit.
* *
* @param data The raw image data. * @param data The raw image data.
*
* @return The created image. * @return The created image.
*/ */
public Image createImage(byte[] data) public Image createImage(byte[] data)
...@@ -500,6 +556,7 @@ public abstract class Toolkit ...@@ -500,6 +556,7 @@ public abstract class Toolkit
* @param data The raw image data. * @param data The raw image data.
* @param offset The offset into the data where the image data starts. * @param offset The offset into the data where the image data starts.
* @param len The length of the image data. * @param len The length of the image data.
*
* @return The created image. * @return The created image.
*/ */
public abstract Image createImage(byte[] data, int offset, int len); public abstract Image createImage(byte[] data, int offset, int len);
...@@ -511,6 +568,7 @@ public abstract class Toolkit ...@@ -511,6 +568,7 @@ public abstract class Toolkit
* @param frame The window initiating the print job. * @param frame The window initiating the print job.
* @param title The print job title. * @param title The print job title.
* @param props The print job properties. * @param props The print job properties.
*
* @return The requested print job, or <code>null</code> if the job * @return The requested print job, or <code>null</code> if the job
* was cancelled. * was cancelled.
*/ */
...@@ -536,10 +594,14 @@ public abstract class Toolkit ...@@ -536,10 +594,14 @@ public abstract class Toolkit
* Returns the system clipboard. * Returns the system clipboard.
* *
* @return THe system clipboard. * @return THe system clipboard.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public abstract Clipboard getSystemClipboard(); public abstract Clipboard getSystemClipboard();
/** /**
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*
* @since 1.4 * @since 1.4
*/ */
public Clipboard getSystemSelection() public Clipboard getSystemSelection()
...@@ -553,6 +615,8 @@ public abstract class Toolkit ...@@ -553,6 +615,8 @@ public abstract class Toolkit
* to change the default. * to change the default.
* *
* @return The key mask for the menu accelerator key. * @return The key mask for the menu accelerator key.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public int getMenuShortcutKeyMask() public int getMenuShortcutKeyMask()
{ {
......
...@@ -86,32 +86,56 @@ public class Window extends Container ...@@ -86,32 +86,56 @@ public class Window extends Container
* parent. The window will initially be invisible. * parent. The window will initially be invisible.
* *
* @param parent The owning <code>Frame</code> of this window. * @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) 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) public Window(Window owner)
{ {
this(); this (owner, owner.getGraphicsConfiguration ());
}
/**
* 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 ();
if (owner == null) if (owner == null)
throw new IllegalArgumentException("owner must not be null"); throw new IllegalArgumentException ("owner must not be null");
this.parent = owner; this.parent = owner;
// FIXME: add to owner's "owned window" list // FIXME: add to owner's "owned window" list
//owner.owned.add(this); // this should be a weak reference //owner.owned.add(this); // this should be a weak reference
}
/** @since 1.3 */
public Window(Window owner, GraphicsConfiguration gc)
{
this(owner);
/* FIXME: Security check /* FIXME: Security check
SecurityManager.checkTopLevelWindow(...) SecurityManager.checkTopLevelWindow(...)
*/
if (gc != null if (gc != null
&& gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN) && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)
...@@ -122,7 +146,6 @@ public class Window extends Container ...@@ -122,7 +146,6 @@ public class Window extends Container
.getDefaultScreenDevice() .getDefaultScreenDevice()
.getDefaultConfiguration(); .getDefaultConfiguration();
else else
*/
graphicsConfiguration = gc; graphicsConfiguration = gc;
} }
...@@ -134,6 +157,12 @@ public class Window extends Container ...@@ -134,6 +157,12 @@ public class Window extends Container
return super.getGraphicsConfigurationImpl(); 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 protected void finalize() throws Throwable
{ {
// FIXME: remove from owner's "owned window" list (Weak References) // FIXME: remove from owner's "owned window" list (Weak References)
...@@ -185,7 +214,7 @@ public class Window extends Container ...@@ -185,7 +214,7 @@ public class Window extends Container
public void hide() public void hide()
{ {
// FIXME: call hide() on amy "owned" children here. // FIXME: call hide() on any "owned" children here.
super.hide(); super.hide();
} }
...@@ -338,6 +367,11 @@ public class Window extends Container ...@@ -338,6 +367,11 @@ public class Window extends Container
windowListener = AWTEventMulticaster.remove(windowListener, listener); windowListener = AWTEventMulticaster.remove(windowListener, listener);
} }
/**
* Returns an array of all the window listeners registered on this window.
*
* @since 1.4
*/
public synchronized WindowListener[] getWindowListeners() public synchronized WindowListener[] getWindowListeners()
{ {
return (WindowListener[]) return (WindowListener[])
...@@ -345,7 +379,16 @@ public class Window extends Container ...@@ -345,7 +379,16 @@ public class Window extends Container
WindowListener.class); 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) public EventListener[] getListeners(Class listenerType)
{ {
if (listenerType == WindowListener.class) if (listenerType == WindowListener.class)
......
...@@ -131,6 +131,13 @@ public abstract class ColorSpace implements Serializable ...@@ -131,6 +131,13 @@ public abstract class ColorSpace implements Serializable
return false; 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[] toRGB(float[] colorvalue);
public abstract float[] fromRGB(float[] rgbvalue); public abstract float[] fromRGB(float[] rgbvalue);
......
...@@ -81,6 +81,12 @@ public class ICC_ColorSpace extends ColorSpace ...@@ -81,6 +81,12 @@ public class ICC_ColorSpace extends ColorSpace
*/ */
private boolean needScaleInit; 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) public ICC_ColorSpace(ICC_Profile profile)
{ {
super(CS_sRGB, profile.getNumComponents()); super(CS_sRGB, profile.getNumComponents());
...@@ -92,18 +98,45 @@ public class ICC_ColorSpace extends ColorSpace ...@@ -92,18 +98,45 @@ public class ICC_ColorSpace extends ColorSpace
return thisProfile; 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) public float[] toRGB(float[] colorvalue)
{ {
if (colorvalue.length < numComponents)
throw new IllegalArgumentException ();
// FIXME: Always assumes sRGB: // FIXME: Always assumes sRGB:
return colorvalue; 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) public float[] fromRGB(float[] rgbvalue)
{ {
if (rgbvalue.length < 3)
throw new IllegalArgumentException ();
// FIXME: Always assumes sRGB: // FIXME: Always assumes sRGB:
return rgbvalue; 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) public float[] toCIEXYZ(float[] colorvalue)
{ {
// FIXME: Not implemented // FIXME: Not implemented
......
...@@ -86,6 +86,7 @@ public abstract class Dimension2D implements Cloneable ...@@ -86,6 +86,7 @@ public abstract class Dimension2D implements Cloneable
* may occur. * may occur.
* *
* @param d the dimension containing the new values * @param d the dimension containing the new values
*
* @throws NullPointerException if d is null * @throws NullPointerException if d is null
*/ */
public void setSize(Dimension2D d) public void setSize(Dimension2D d)
...@@ -98,6 +99,10 @@ public abstract class Dimension2D implements Cloneable ...@@ -98,6 +99,10 @@ public abstract class Dimension2D implements Cloneable
* as this one. * as this one.
* *
* @return the clone * @return the clone
*
* @exception OutOfMemoryError If there is not enough memory available.
*
* @since 1.2
*/ */
public Object clone() public Object clone()
{ {
......
...@@ -338,6 +338,10 @@ public final class GeneralPath implements Shape, Cloneable ...@@ -338,6 +338,10 @@ public final class GeneralPath implements Shape, Cloneable
* this one. * this one.
* *
* @return the clone * @return the clone
*
* @exception OutOfMemoryError If there is not enough memory available.
*
* @since 1.2
*/ */
public Object clone() public Object clone()
{ {
......
...@@ -752,6 +752,10 @@ public abstract class Line2D implements Shape, Cloneable ...@@ -752,6 +752,10 @@ public abstract class Line2D implements Shape, Cloneable
* this one. * this one.
* *
* @return the clone * @return the clone
*
* @exception OutOfMemoryError If there is not enough memory available.
*
* @since 1.2
*/ */
public Object clone() public Object clone()
{ {
......
...@@ -289,6 +289,10 @@ public abstract class QuadCurve2D implements Shape, Cloneable ...@@ -289,6 +289,10 @@ public abstract class QuadCurve2D implements Shape, Cloneable
* this one. * this one.
* *
* @return the clone * @return the clone
*
* @exception OutOfMemoryError If there is not enough memory available.
*
* @since 1.2
*/ */
public Object clone() public Object clone()
{ {
......
...@@ -120,10 +120,32 @@ public abstract class ColorModel implements Transparency ...@@ -120,10 +120,32 @@ public abstract class ColorModel implements Transparency
Buffers.smallestAppropriateTransferType(bits * 4)); 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, protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace,
boolean hasAlpha, boolean isAlphaPremultiplied, boolean hasAlpha, boolean isAlphaPremultiplied,
int transparency, int transferType) 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.pixel_bits = pixel_bits;
this.bits = bits; this.bits = bits;
this.cspace = cspace; this.cspace = cspace;
......
...@@ -81,9 +81,18 @@ public class ImageFilter implements ImageConsumer, Cloneable ...@@ -81,9 +81,18 @@ public class ImageFilter implements ImageConsumer, Cloneable
* *
* @see java.lang.Object#clone () * @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 ();
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment