Commit 62d2eed6 by Tom Tromey Committed by Tom Tromey

Makefile.in: Rebuilt.

	* Makefile.in: Rebuilt.
	* Makefile.am (rmi_java_source_files): Added RMIClassLoaderSpi.
	* java/awt/AlphaComposite.java, java/awt/BasicStroke.java,
	java/awt/BufferCapabilities.java, java/awt/Button.java,
	java/awt/CheckboxMenuItem.java, java/awt/Choice.java,
	java/awt/Container.java, java/awt/Cursor.java,
	java/awt/EventQueue.java, java/awt/FileDialog.java,
	java/awt/Graphics2D.java, java/awt/Label.java, java/awt/Menu.java,
	java/awt/MenuBar.java, java/awt/MenuComponent.java,
	java/awt/PopupMenu.java, java/awt/ScrollPane.java,
	java/awt/Scrollbar.java, java/awt/TextArea.java,
	java/awt/TextField.java, java/awt/color/CMMException.java,
	java/awt/color/ColorSpace.java, java/awt/color/ICC_Profile.java,
	java/awt/color/ProfileDataException.java,
	java/awt/datatransfer/Clipboard.java,
	java/awt/datatransfer/DataFlavor.java,
	java/awt/datatransfer/FlavorMap.java,
	java/awt/datatransfer/SystemFlavorMap.java,
	java/awt/dnd/DragGestureEvent.java,
	java/awt/dnd/DragGestureRecognizer.java,
	java/awt/dnd/DragSource.java, java/awt/dnd/DropTarget.java,
	java/awt/event/WindowEvent.java, java/awt/geom/PathIterator.java,
	java/awt/im/InputMethodHighlight.java,
	java/io/PipedOutputStream.java, java/io/PipedWriter.java,
	java/rmi/server/RMIClassLoader.java: Merged from Classpath.

	* gnu/awt/j2d/Graphics2DImpl.java (drawImage): Changed type of
	`op' to BufferedImageOp.

From-SVN: r60768
parent 3c32ae1c
2003-01-01 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (rmi_java_source_files): Added RMIClassLoaderSpi.
* java/awt/AlphaComposite.java, java/awt/BasicStroke.java,
java/awt/BufferCapabilities.java, java/awt/Button.java,
java/awt/CheckboxMenuItem.java, java/awt/Choice.java,
java/awt/Container.java, java/awt/Cursor.java,
java/awt/EventQueue.java, java/awt/FileDialog.java,
java/awt/Graphics2D.java, java/awt/Label.java, java/awt/Menu.java,
java/awt/MenuBar.java, java/awt/MenuComponent.java,
java/awt/PopupMenu.java, java/awt/ScrollPane.java,
java/awt/Scrollbar.java, java/awt/TextArea.java,
java/awt/TextField.java, java/awt/color/CMMException.java,
java/awt/color/ColorSpace.java, java/awt/color/ICC_Profile.java,
java/awt/color/ProfileDataException.java,
java/awt/datatransfer/Clipboard.java,
java/awt/datatransfer/DataFlavor.java,
java/awt/datatransfer/FlavorMap.java,
java/awt/datatransfer/SystemFlavorMap.java,
java/awt/dnd/DragGestureEvent.java,
java/awt/dnd/DragGestureRecognizer.java,
java/awt/dnd/DragSource.java, java/awt/dnd/DropTarget.java,
java/awt/event/WindowEvent.java, java/awt/geom/PathIterator.java,
java/awt/im/InputMethodHighlight.java,
java/io/PipedOutputStream.java, java/io/PipedWriter.java,
java/rmi/server/RMIClassLoader.java: Merged from Classpath.
* gnu/awt/j2d/Graphics2DImpl.java (drawImage): Changed type of
`op' to BufferedImageOp.
2002-12-31 Tom Tromey <tromey@redhat.com> 2002-12-31 Tom Tromey <tromey@redhat.com>
Fix for PR libgcj/7416: Fix for PR libgcj/7416:
......
...@@ -1336,6 +1336,7 @@ java/rmi/server/LogStream.java \ ...@@ -1336,6 +1336,7 @@ java/rmi/server/LogStream.java \
java/rmi/server/ObjID.java \ java/rmi/server/ObjID.java \
java/rmi/server/Operation.java \ java/rmi/server/Operation.java \
java/rmi/server/RMIClassLoader.java \ java/rmi/server/RMIClassLoader.java \
java/rmi/server/RMIClassLoaderSpi.java \
java/rmi/server/RMIClientSocketFactory.java \ java/rmi/server/RMIClientSocketFactory.java \
java/rmi/server/RMIFailureHandler.java \ java/rmi/server/RMIFailureHandler.java \
java/rmi/server/RMIServerSocketFactory.java \ java/rmi/server/RMIServerSocketFactory.java \
......
...@@ -1096,6 +1096,7 @@ java/rmi/server/LogStream.java \ ...@@ -1096,6 +1096,7 @@ java/rmi/server/LogStream.java \
java/rmi/server/ObjID.java \ java/rmi/server/ObjID.java \
java/rmi/server/Operation.java \ java/rmi/server/Operation.java \
java/rmi/server/RMIClassLoader.java \ java/rmi/server/RMIClassLoader.java \
java/rmi/server/RMIClassLoaderSpi.java \
java/rmi/server/RMIClientSocketFactory.java \ java/rmi/server/RMIClientSocketFactory.java \
java/rmi/server/RMIFailureHandler.java \ java/rmi/server/RMIFailureHandler.java \
java/rmi/server/RMIServerSocketFactory.java \ java/rmi/server/RMIServerSocketFactory.java \
...@@ -3164,6 +3165,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \ ...@@ -3164,6 +3165,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/rmi/server/LoaderHandler.P .deps/java/rmi/server/LogStream.P \ .deps/java/rmi/server/LoaderHandler.P .deps/java/rmi/server/LogStream.P \
.deps/java/rmi/server/ObjID.P .deps/java/rmi/server/Operation.P \ .deps/java/rmi/server/ObjID.P .deps/java/rmi/server/Operation.P \
.deps/java/rmi/server/RMIClassLoader.P \ .deps/java/rmi/server/RMIClassLoader.P \
.deps/java/rmi/server/RMIClassLoaderSpi.P \
.deps/java/rmi/server/RMIClientSocketFactory.P \ .deps/java/rmi/server/RMIClientSocketFactory.P \
.deps/java/rmi/server/RMIFailureHandler.P \ .deps/java/rmi/server/RMIFailureHandler.P \
.deps/java/rmi/server/RMIServerSocketFactory.P \ .deps/java/rmi/server/RMIServerSocketFactory.P \
......
/* Copyright (C) 2000, 2002 Free Software Foundation /* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of libgcj. This file is part of libgcj.
...@@ -24,6 +24,7 @@ import java.awt.Stroke; ...@@ -24,6 +24,7 @@ import java.awt.Stroke;
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
import java.awt.image.ImageObserver; import java.awt.image.ImageObserver;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.awt.image.BufferedImageOp;
import java.awt.image.RenderedImage; import java.awt.image.RenderedImage;
import java.awt.image.renderable.RenderableImage; import java.awt.image.renderable.RenderableImage;
import java.text.AttributedCharacterIterator; import java.text.AttributedCharacterIterator;
...@@ -459,7 +460,7 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable ...@@ -459,7 +460,7 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
throw new UnsupportedOperationException(msg); throw new UnsupportedOperationException(msg);
} }
public void drawImage(BufferedImage image, BufferedImage op, int x, int y) public void drawImage(BufferedImage image, BufferedImageOp op, int x, int y)
{ {
throw new UnsupportedOperationException("not implemented yet"); throw new UnsupportedOperationException("not implemented yet");
} }
......
...@@ -64,6 +64,7 @@ public final class AlphaComposite implements Composite ...@@ -64,6 +64,7 @@ public final class AlphaComposite implements Composite
return size() > MAX_CACHE_SIZE; return size() > MAX_CACHE_SIZE;
} }
}; };
public static final int CLEAR = 1; public static final int CLEAR = 1;
public static final int SRC = 2; public static final int SRC = 2;
public static final int DST = 9; public static final int DST = 9;
...@@ -88,6 +89,7 @@ public final class AlphaComposite implements Composite ...@@ -88,6 +89,7 @@ public final class AlphaComposite implements Composite
public static final AlphaComposite SrcAtop = getInstance(SRC_ATOP); public static final AlphaComposite SrcAtop = getInstance(SRC_ATOP);
public static final AlphaComposite DstAtop = getInstance(DST_ATOP); public static final AlphaComposite DstAtop = getInstance(DST_ATOP);
public static final AlphaComposite Xor = getInstance(XOR); public static final AlphaComposite Xor = getInstance(XOR);
private final int rule; private final int rule;
private final float alpha; private final float alpha;
private AlphaComposite(int rule, float alpha) private AlphaComposite(int rule, float alpha)
...@@ -95,10 +97,32 @@ public final class AlphaComposite implements Composite ...@@ -95,10 +97,32 @@ public final class AlphaComposite implements Composite
this.rule = rule; this.rule = rule;
this.alpha = alpha; this.alpha = alpha;
} }
/**
* Creates an AlphaComposite object with the specified rule.
*
* @param rule The compositing rule.
*
* @exception IllegalArgumentException If rule is not one of the following:
* CLEAR, SRC, DST, SRC_OVER, DST_OVER, SRC_IN, DST_IN, SRC_OUT, DST_OUT,
* SRC_ATOP, DST_ATOP, or XOR.
*/
public static AlphaComposite getInstance(int rule) public static AlphaComposite getInstance(int rule)
{ {
return getInstance(rule, 1); return getInstance(rule, 1);
} }
/**
* Creates an AlphaComposite object with the specified rule and the constant
* alpha to multiply with the alpha of the source. The source is multiplied
* with the specified alpha before being composited with the destination.
*
* @param rule The compositing rule.
*
* @exception IllegalArgumentException If rule is not one of the following:
* CLEAR, SRC, DST, SRC_OVER, DST_OVER, SRC_IN, DST_IN, SRC_OUT, DST_OUT,
* SRC_ATOP, DST_ATOP, or XOR.
*/
public static AlphaComposite getInstance(int rule, float alpha) public static AlphaComposite getInstance(int rule, float alpha)
{ {
if (rule < CLEAR || rule > XOR || ! (alpha >= 0 && alpha <= 1)) if (rule < CLEAR || rule > XOR || ! (alpha >= 0 && alpha <= 1))
......
/* BasicStroke.java -- /* BasicStroke.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -59,12 +59,31 @@ public class BasicStroke implements Stroke ...@@ -59,12 +59,31 @@ public class BasicStroke implements Stroke
private final float[] dash; private final float[] dash;
private final float phase; private final float phase;
/**
* Creates a basic stroke.
*
* @param width May not be negative .
* @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
* @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
* @param miterlimit the limit to trim the miter join. The miterlimit must be
* greater than or equal to 1.0f.
* @param dash The array representing the dashing pattern.
* @param dash_phase is negative and dash is not null.
*
* @exception IllegalArgumentException If one input parameter doesn't meet
* its needs.
*/
public BasicStroke(float width, int cap, int join, float miterlimit, public BasicStroke(float width, int cap, int join, float miterlimit,
float[] dash, float dashPhase) float[] dash, float dashPhase)
{ {
if (width < 0 || miterlimit < 1 || cap < CAP_BUTT || cap > CAP_SQUARE if (width < 0 ||
|| join < JOIN_MITER || join > JOIN_BEVEL) miterlimit < 1.0f ||
cap < CAP_BUTT ||
cap > CAP_SQUARE ||
join < JOIN_MITER ||
join > JOIN_BEVEL)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
this.width = width; this.width = width;
this.cap = cap; this.cap = cap;
this.join = join; this.join = join;
...@@ -73,21 +92,54 @@ public class BasicStroke implements Stroke ...@@ -73,21 +92,54 @@ public class BasicStroke implements Stroke
phase = dashPhase; phase = dashPhase;
} }
/**
* Creates a basic stroke.
*
* @param width The width of the BasicStroke. May not be negative .
* @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
* @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
* @param miterlimit the limit to trim the miter join. The miterlimit must be
* greater than or equal to 1.0f.
*
* @exception IllegalArgumentException If one input parameter doesn't meet
* its needs.
*/
public BasicStroke(float width, int cap, int join, float miterlimit) public BasicStroke(float width, int cap, int join, float miterlimit)
{ {
this(width, cap, join, miterlimit, null, 0); this(width, cap, join, miterlimit, null, 0);
} }
/**
* Creates a basic stroke.
*
* @param width The width of the BasicStroke. May not be nehative.
* @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
* @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
*
* @exception IllegalArgumentException If one input parameter doesn't meet
* its needs.
* @exception IllegalArgumentException FIXME
*/
public BasicStroke(float width, int cap, int join) public BasicStroke(float width, int cap, int join)
{ {
this(width, cap, join, 10, null, 0); this(width, cap, join, 10, null, 0);
} }
/**
* Creates a basic stroke.
*
* @param width The width of the BasicStroke.
*
* @exception IllegalArgumentException If width is negative.
*/
public BasicStroke(float width) public BasicStroke(float width)
{ {
this(width, CAP_SQUARE, JOIN_MITER, 10, null, 0); this(width, CAP_SQUARE, JOIN_MITER, 10, null, 0);
} }
/**
* Creates a basic stroke.
*/
public BasicStroke() public BasicStroke()
{ {
this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0); this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0);
......
...@@ -67,6 +67,11 @@ public class BufferCapabilities implements Cloneable ...@@ -67,6 +67,11 @@ public class BufferCapabilities implements Cloneable
private final ImageCapabilities back; private final ImageCapabilities back;
private final FlipContents flip; private final FlipContents flip;
/**
* Creates a buffer capabilities object.
*
* @exception IllegalArgumentException If frontCaps or backCaps are null.
*/
public BufferCapabilities(ImageCapabilities front, ImageCapabilities back, public BufferCapabilities(ImageCapabilities front, ImageCapabilities back,
FlipContents flip) FlipContents flip)
{ {
......
...@@ -90,6 +90,9 @@ private transient ActionListener action_listeners; ...@@ -90,6 +90,9 @@ private transient ActionListener action_listeners;
/** /**
* Initializes a new instance of <code>Button</code> with no label. * Initializes a new instance of <code>Button</code> with no label.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless()
* returns true
*/ */
public public
Button() Button()
...@@ -104,12 +107,18 @@ Button() ...@@ -104,12 +107,18 @@ Button()
* label. The action command name is also initialized to this value. * label. The action command name is also initialized to this value.
* *
* @param label The label to display on the button. * @param label The label to display on the button.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless()
* returns true
*/ */
public public
Button(String label) Button(String label)
{ {
this.label = label; this.label = label;
actionCommand = label; actionCommand = label;
if (GraphicsEnvironment.isHeadless ())
throw new HeadlessException ();
} }
/*************************************************************************/ /*************************************************************************/
...@@ -211,6 +220,10 @@ removeActionListener(ActionListener listener) ...@@ -211,6 +220,10 @@ removeActionListener(ActionListener listener)
/** Returns all registered EventListers of the given listenerType. /** Returns all registered EventListers of the given listenerType.
* listenerType must be a subclass of EventListener, or a * listenerType must be a subclass of EventListener, or a
* ClassClassException is thrown. * ClassClassException is thrown.
*
* @exception ClassCastException If listenerType doesn't specify a class or
* interface that implements @see java.util.EventListener.
*
* @since 1.3 * @since 1.3
*/ */
public EventListener[] getListeners(Class listenerType) public EventListener[] getListeners(Class listenerType)
......
...@@ -84,6 +84,9 @@ private transient ItemListener item_listeners; ...@@ -84,6 +84,9 @@ private transient ItemListener item_listeners;
/** /**
* Initializes a new instance of <code>CheckboxMenuItem</code> with no * Initializes a new instance of <code>CheckboxMenuItem</code> with no
* label and an initial state of off. * label and an initial state of off.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless()
* returns true.
*/ */
public public
CheckboxMenuItem() CheckboxMenuItem()
...@@ -98,6 +101,9 @@ CheckboxMenuItem() ...@@ -98,6 +101,9 @@ CheckboxMenuItem()
* specified label and an initial state of off. * specified label and an initial state of off.
* *
* @param label The label of the menu item. * @param label The label of the menu item.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless()
* returns true.
*/ */
public public
CheckboxMenuItem(String label) CheckboxMenuItem(String label)
...@@ -114,12 +120,18 @@ CheckboxMenuItem(String label) ...@@ -114,12 +120,18 @@ CheckboxMenuItem(String label)
* @param label The label of the menu item. * @param label The label of the menu item.
* @param state The initial state of the menu item, where <code>true</code> * @param state The initial state of the menu item, where <code>true</code>
* is on, and <code>false</code> is off. * is on, and <code>false</code> is off.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless()
* returns true.
*/ */
public public
CheckboxMenuItem(String label, boolean state) CheckboxMenuItem(String label, boolean state)
{ {
super(label); super(label);
this.state = state; this.state = state;
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
} }
/*************************************************************************/ /*************************************************************************/
......
...@@ -85,13 +85,17 @@ private ItemListener item_listeners; ...@@ -85,13 +85,17 @@ private ItemListener item_listeners;
* Constructors * Constructors
*/ */
/** /**
* Initializes a new instance of <code>Choice</code>. * Initializes a new instance of <code>Choice</code>.
*/ *
public * @exception HeadlessException If GraphicsEnvironment.isHeadless()
Choice() * returns true
{ */
} public Choice()
{
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
}
/*************************************************************************/ /*************************************************************************/
...@@ -146,12 +150,16 @@ getItem(int index) ...@@ -146,12 +150,16 @@ getItem(int index)
* Adds the specified item to this choice box. * Adds the specified item to this choice box.
* *
* @param item The item to add. * @param item The item to add.
*
* @exception NullPointerException If the item's value is null
*
* @since 1.1
*/ */
public synchronized void public synchronized void
add(String item) add(String item)
{ {
if (item == null) if (item == null)
throw new IllegalArgumentException ("item must be non-null"); throw new NullPointerException ("item must be non-null");
pItems.addElement(item); pItems.addElement(item);
...@@ -171,7 +179,12 @@ add(String item) ...@@ -171,7 +179,12 @@ add(String item)
/** /**
* Adds the specified item to this choice box. * Adds the specified item to this choice box.
* *
* This method is oboslete since Java 2 platform 1.1. Please use @see add
* instead.
*
* @param item The item to add. * @param item The item to add.
*
* @exception NullPointerException If the item's value is equal to null
*/ */
public synchronized void public synchronized void
addItem(String item) addItem(String item)
...@@ -189,10 +202,15 @@ addItem(String item) ...@@ -189,10 +202,15 @@ addItem(String item)
* *
* @param item The item to add. * @param item The item to add.
* @param index The index at which the item should be inserted. * @param index The index at which the item should be inserted.
*
* @exception IllegalArgumentException If index is less than 0
*/ */
public synchronized void public synchronized void
insert(String item, int index) insert(String item, int index)
{ {
if (index < 0)
throw new IllegalArgumentException ("index may not be less then 0");
if (index > getItemCount ()) if (index > getItemCount ())
index = getItemCount (); index = getItemCount ();
......
...@@ -133,11 +133,14 @@ public class Cursor implements java.io.Serializable ...@@ -133,11 +133,14 @@ public class Cursor implements java.io.Serializable
* type. * type.
* *
* @param type The cursor type. * @param type The cursor type.
*
* @exception IllegalArgumentException If the specified cursor type is invalid
*/ */
public Cursor(int type) public Cursor(int type)
{ {
if (type < 0 || type >= PREDEFINED_COUNT) if (type < 0 || type >= PREDEFINED_COUNT)
throw new IllegalArgumentException ("invalid cursor " + type); throw new IllegalArgumentException ("invalid cursor " + type);
this.type = type; this.type = type;
// FIXME: lookup and set name? // FIXME: lookup and set name?
} }
...@@ -171,9 +174,20 @@ public class Cursor implements java.io.Serializable ...@@ -171,9 +174,20 @@ public class Cursor implements java.io.Serializable
return predefined[type]; return predefined[type];
} }
/**
* Retrieves the system specific custom Cursor named Cursor names are,
* for example: "Invalid.16x16".
*
* @exception AWTException
* @exception HeadlessException If GraphicsEnvironment.isHeadless()
* returns true.
*/
public static Cursor getSystemCustomCursor(String name) public static Cursor getSystemCustomCursor(String name)
throws AWTException throws AWTException
{ {
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
// FIXME // FIXME
return null; return null;
} }
......
...@@ -151,6 +151,8 @@ public class EventQueue ...@@ -151,6 +151,8 @@ public class EventQueue
* Posts a new event to the queue. * Posts a new event to the queue.
* *
* @param event The event to post to the queue. * @param event The event to post to the queue.
*
* @exception NullPointerException If event is null.
*/ */
public synchronized void postEvent(AWTEvent evt) public synchronized void postEvent(AWTEvent evt)
{ {
...@@ -209,7 +211,19 @@ public class EventQueue ...@@ -209,7 +211,19 @@ public class EventQueue
notify(); notify();
} }
/** @since JDK1.2 */ /**
* Causes runnable to have its run method called in the dispatch thread of the
* EventQueue. This will happen after all pending events are processed. The
* call blocks until this has happened. This method will throw an Error if
* called from the event dispatcher thread.
*
* @exception InterruptedException If another thread has interrupted
* this thread.
* @exception InvocationTargetException If an exception is thrown when running
* runnable.
*
* @since 1.2
*/
public static void invokeAndWait(Runnable runnable) public static void invokeAndWait(Runnable runnable)
throws InterruptedException, InvocationTargetException throws InterruptedException, InvocationTargetException
{ {
...@@ -254,6 +268,8 @@ public class EventQueue ...@@ -254,6 +268,8 @@ public class EventQueue
* All pending events are transferred to the new queue. Calls to postEvent, * All pending events are transferred to the new queue. Calls to postEvent,
* getNextEvent, and peekEvent are forwarded to the pushed queue until it * getNextEvent, and peekEvent are forwarded to the pushed queue until it
* is removed with a pop(). * is removed with a pop().
*
* @exception NullPointerException if newEventQueue is null.
*/ */
public synchronized void push(EventQueue newEventQueue) public synchronized void push(EventQueue newEventQueue)
{ {
...@@ -271,7 +287,11 @@ public class EventQueue ...@@ -271,7 +287,11 @@ public class EventQueue
} }
/** Transfer any pending events from this queue back to the parent queue that /** Transfer any pending events from this queue back to the parent queue that
* was previously push()ed. Event dispatch from this queue is suspended. */ * was previously push()ed. Event dispatch from this queue is suspended.
*
* @exception EmptyStackException If no previous push was made on this
* EventQueue.
*/
protected void pop() throws EmptyStackException protected void pop() throws EmptyStackException
{ {
if (prev == null) if (prev == null)
...@@ -297,6 +317,12 @@ public class EventQueue ...@@ -297,6 +317,12 @@ public class EventQueue
} }
} }
/**
* Dispatches an event. The manner in which the event is dispatched depends
* upon the type of the event and the type of the event's source object.
*
* @exception NullPointerException If event is null.
*/
protected void dispatchEvent(AWTEvent evt) protected void dispatchEvent(AWTEvent evt)
{ {
if (evt instanceof ActiveEvent) if (evt instanceof ActiveEvent)
......
...@@ -142,16 +142,15 @@ FileDialog(Frame parent, String title) ...@@ -142,16 +142,15 @@ FileDialog(Frame parent, String title)
* @param title The title for this dialog. * @param title The title for this dialog.
* @param mode The mode of the dialog, either <code>LOAD</code> or * @param mode The mode of the dialog, either <code>LOAD</code> or
* <code>SAVE</code>. * <code>SAVE</code>.
*
* @exception IllegalArgumentException If an illegal file dialog mode
* is supplied.
*/ */
public public
FileDialog(Frame parent, String title, int mode) FileDialog(Frame parent, String title, int mode)
{ {
super(parent, title, true); super(parent, title, true);
setMode (mode);
if ((mode != LOAD) && (mode != SAVE))
throw new IllegalArgumentException("Bad mode: " + mode);
this.mode = mode;
} }
/*************************************************************************/ /*************************************************************************/
...@@ -180,6 +179,9 @@ getMode() ...@@ -180,6 +179,9 @@ getMode()
* peer is created. * peer is created.
* *
* @param mode The new mode of this file dialog. * @param mode The new mode of this file dialog.
*
* @exception IllegalArgumentException If an illegal file dialog mode
* is supplied.
*/ */
public void public void
setMode(int mode) setMode(int mode)
......
...@@ -38,6 +38,7 @@ package java.awt; ...@@ -38,6 +38,7 @@ package java.awt;
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.awt.image.BufferedImageOp;
import java.awt.image.RenderedImage; import java.awt.image.RenderedImage;
import java.awt.image.ImageObserver; import java.awt.image.ImageObserver;
import java.awt.image.renderable.RenderableImage; import java.awt.image.renderable.RenderableImage;
...@@ -74,7 +75,7 @@ public abstract class Graphics2D extends Graphics ...@@ -74,7 +75,7 @@ public abstract class Graphics2D extends Graphics
ImageObserver obs); ImageObserver obs);
public abstract void drawImage(BufferedImage image, public abstract void drawImage(BufferedImage image,
BufferedImage op, BufferedImageOp op,
int x, int x,
int y); int y);
......
...@@ -99,6 +99,8 @@ private String text; ...@@ -99,6 +99,8 @@ private String text;
/** /**
* Initializes a new instance of <code>Label</code> with no text. * Initializes a new instance of <code>Label</code> with no text.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
Label() Label()
...@@ -113,6 +115,8 @@ Label() ...@@ -113,6 +115,8 @@ Label()
* text that is aligned to the left. * text that is aligned to the left.
* *
* @param text The text of the label. * @param text The text of the label.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
Label(String text) Label(String text)
...@@ -130,12 +134,17 @@ Label(String text) ...@@ -130,12 +134,17 @@ Label(String text)
* @param alignment The desired alignment for the text in this label, * @param alignment The desired alignment for the text in this label,
* which must be one of <code>LEFT</code>, <code>CENTER</code>, or * which must be one of <code>LEFT</code>, <code>CENTER</code>, or
* <code>RIGHT</code>. * <code>RIGHT</code>.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
Label(String text, int alignment) Label(String text, int alignment)
{ {
setAlignment (alignment); setAlignment (alignment);
setText (text); setText (text);
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
} }
/*************************************************************************/ /*************************************************************************/
......
...@@ -95,6 +95,8 @@ static final MenuItem separator = new MenuItem("-"); ...@@ -95,6 +95,8 @@ static final MenuItem separator = new MenuItem("-");
/** /**
* Initializes a new instance of <code>Menu</code> with no label and that * Initializes a new instance of <code>Menu</code> with no label and that
* is not a tearoff; * is not a tearoff;
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
Menu() Menu()
...@@ -108,6 +110,8 @@ Menu() ...@@ -108,6 +110,8 @@ Menu()
* that has the specified label. * that has the specified label.
* *
* @param label The menu label. * @param label The menu label.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
Menu(String label) Menu(String label)
...@@ -124,6 +128,8 @@ Menu(String label) ...@@ -124,6 +128,8 @@ Menu(String label)
* @param label The label for this menu * @param label The label for this menu
* @param isTearOff <code>true</code> if this menu is a tear off menu, * @param isTearOff <code>true</code> if this menu is a tear off menu,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
Menu(String label, boolean isTearOff) Menu(String label, boolean isTearOff)
...@@ -134,6 +140,9 @@ Menu(String label, boolean isTearOff) ...@@ -134,6 +140,9 @@ Menu(String label, boolean isTearOff)
if (label.equals("Help")) if (label.equals("Help"))
isHelpMenu = true; isHelpMenu = true;
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
} }
/*************************************************************************/ /*************************************************************************/
......
...@@ -86,10 +86,14 @@ private Vector menus = new Vector(); ...@@ -86,10 +86,14 @@ private Vector menus = new Vector();
/** /**
* Initializes a new instance of <code>MenuBar</code>. * Initializes a new instance of <code>MenuBar</code>.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
MenuBar() MenuBar()
{ {
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
} }
/*************************************************************************/ /*************************************************************************/
......
...@@ -92,10 +92,14 @@ private static transient Toolkit toolkit = Toolkit.getDefaultToolkit(); ...@@ -92,10 +92,14 @@ private static transient Toolkit toolkit = Toolkit.getDefaultToolkit();
/** /**
* Default constructor for subclasses. * Default constructor for subclasses.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
protected protected
MenuComponent() MenuComponent()
{ {
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
} }
/*************************************************************************/ /*************************************************************************/
......
...@@ -65,6 +65,9 @@ private static final long serialVersionUID = -4620452533522760060L; ...@@ -65,6 +65,9 @@ private static final long serialVersionUID = -4620452533522760060L;
/** /**
* Initializes a new instance of <code>PopupMenu</code>. * Initializes a new instance of <code>PopupMenu</code>.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless()
* returns true.
*/ */
public public
PopupMenu() PopupMenu()
...@@ -78,11 +81,17 @@ PopupMenu() ...@@ -78,11 +81,17 @@ PopupMenu()
* label. * label.
* *
* @param label The label for this popup menu. * @param label The label for this popup menu.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless()
* returns true.
*/ */
public public
PopupMenu(String label) PopupMenu(String label)
{ {
super(label); super(label);
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
} }
/*************************************************************************/ /*************************************************************************/
......
...@@ -113,6 +113,8 @@ private Point scrollPosition = new Point(0, 0); ...@@ -113,6 +113,8 @@ private Point scrollPosition = new Point(0, 0);
/** /**
* Initializes a new instance of <code>ScrollPane</code> with a default * Initializes a new instance of <code>ScrollPane</code> with a default
* scrollbar policy of <code>SCROLLBARS_AS_NEEDED</code>. * scrollbar policy of <code>SCROLLBARS_AS_NEEDED</code>.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
ScrollPane() ScrollPane()
...@@ -128,10 +130,15 @@ ScrollPane() ...@@ -128,10 +130,15 @@ ScrollPane()
* *
* @param scrollbarDisplayPolicy When to display scrollbars, which must * @param scrollbarDisplayPolicy When to display scrollbars, which must
* be one of the constants defined in this class. * be one of the constants defined in this class.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/ */
public public
ScrollPane(int scrollbarDisplayPolicy) ScrollPane(int scrollbarDisplayPolicy)
{ {
if (GraphicsEnvironment.isHeadless ())
throw new HeadlessException ();
this.scrollbarDisplayPolicy = scrollbarDisplayPolicy; this.scrollbarDisplayPolicy = scrollbarDisplayPolicy;
if (scrollbarDisplayPolicy != SCROLLBARS_ALWAYS if (scrollbarDisplayPolicy != SCROLLBARS_ALWAYS
......
/* Scrollbar.java -- AWT Scrollbar widget /* Scrollbar.java -- AWT Scrollbar widget
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -40,7 +40,6 @@ package java.awt; ...@@ -40,7 +40,6 @@ package java.awt;
import java.awt.peer.ScrollbarPeer; 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;
...@@ -126,7 +125,9 @@ private AdjustmentListener adjustment_listeners; ...@@ -126,7 +125,9 @@ private AdjustmentListener adjustment_listeners;
/** /**
* Initializes a new instance of <code>Scrollbar</code> with a * Initializes a new instance of <code>Scrollbar</code> with a
* veritical orientation and default values for all other parameters. * vertical orientation and default values for all other parameters.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
Scrollbar() Scrollbar()
...@@ -145,6 +146,7 @@ Scrollbar() ...@@ -145,6 +146,7 @@ Scrollbar()
* *
* @param orientation The orientation of this scrollbar. * @param orientation The orientation of this scrollbar.
* *
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
* @exception IllegalArgumentException If the orientation value is not valid. * @exception IllegalArgumentException If the orientation value is not valid.
*/ */
public public
...@@ -168,12 +170,16 @@ Scrollbar(int orientation) throws IllegalArgumentException ...@@ -168,12 +170,16 @@ Scrollbar(int orientation) throws IllegalArgumentException
* @param minimum The minimum value of the scrollbar. * @param minimum The minimum value of the scrollbar.
* @param maximum The maximum value of the scrollbar. * @param maximum The maximum value of the scrollbar.
* *
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
* @exception IllegalArgumentException If the orientation value is not valid. * @exception IllegalArgumentException If the orientation value is not valid.
*/ */
public public
Scrollbar(int orientation, int value, int visibleAmount, int minimum, Scrollbar(int orientation, int value, int visibleAmount, int minimum,
int maximum) throws IllegalArgumentException int maximum) throws IllegalArgumentException
{ {
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
if ((orientation != HORIZONTAL) && (orientation != VERTICAL)) if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
throw new IllegalArgumentException("Bad orientation value: " throw new IllegalArgumentException("Bad orientation value: "
+ orientation); + orientation);
......
...@@ -109,6 +109,8 @@ private int scrollbarVisibility; ...@@ -109,6 +109,8 @@ private int scrollbarVisibility;
* Initialize a new instance of <code>TextArea</code> that is empty * Initialize a new instance of <code>TextArea</code> that is empty
* and is one row and one column. Both horizontal and vertical * and is one row and one column. Both horizontal and vertical
* scrollbars will be used. * scrollbars will be used.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextArea() TextArea()
...@@ -124,6 +126,8 @@ TextArea() ...@@ -124,6 +126,8 @@ TextArea()
* scrollbars will be used. * scrollbars will be used.
* *
* @param text The text to display in this text area. * @param text The text to display in this text area.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextArea(String text) TextArea(String text)
...@@ -140,6 +144,8 @@ TextArea(String text) ...@@ -140,6 +144,8 @@ TextArea(String text)
* *
* @param rows The number of rows in this text area. * @param rows The number of rows in this text area.
* @param columns The number of columns in this text area. * @param columns The number of columns in this text area.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextArea(int rows, int columns) TextArea(int rows, int columns)
...@@ -156,6 +162,8 @@ TextArea(int rows, int columns) ...@@ -156,6 +162,8 @@ TextArea(int rows, int columns)
* @param text The text to display in this text area. * @param text The text to display in this text area.
* @param rows The number of rows in this text area. * @param rows The number of rows in this text area.
* @param columns The number of columns in this text area. * @param columns The number of columns in this text area.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextArea(String text, int rows, int columns) TextArea(String text, int rows, int columns)
...@@ -174,12 +182,17 @@ TextArea(String text, int rows, int columns) ...@@ -174,12 +182,17 @@ TextArea(String text, int rows, int columns)
* @param rows The number of rows in this text area. * @param rows The number of rows in this text area.
* @param columns The number of columns in this text area. * @param columns The number of columns in this text area.
* @param scrollbarVisibility Which scrollbars to display. * @param scrollbarVisibility Which scrollbars to display.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextArea(String text, int rows, int columns, int scrollbarVisibility) TextArea(String text, int rows, int columns, int scrollbarVisibility)
{ {
super(text); super(text);
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
if ((rows < 1) || (columns < 0)) if ((rows < 1) || (columns < 0))
throw new IllegalArgumentException("Bad row or column value"); throw new IllegalArgumentException("Bad row or column value");
......
...@@ -84,9 +84,11 @@ private ActionListener action_listeners; ...@@ -84,9 +84,11 @@ private ActionListener action_listeners;
* Constructors * Constructors
*/ */
/* /**
* Initializes a new instance of <code>TextField</code> that is empty * Initializes a new instance of <code>TextField</code> that is empty
* and has one column. * and has one column.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextField() TextField()
...@@ -102,6 +104,8 @@ TextField() ...@@ -102,6 +104,8 @@ TextField()
* length of the text string. * length of the text string.
* *
* @param text The text to display in the field. * @param text The text to display in the field.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextField(String text) TextField(String text)
...@@ -116,6 +120,8 @@ TextField(String text) ...@@ -116,6 +120,8 @@ TextField(String text)
* and has the specified number of columns. * and has the specified number of columns.
* *
* @param columns The number of columns in the text field. * @param columns The number of columns in the text field.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextField(int columns) TextField(int columns)
...@@ -131,12 +137,17 @@ TextField(int columns) ...@@ -131,12 +137,17 @@ TextField(int columns)
* *
* @param text The text to display in the field. * @param text The text to display in the field.
* @param columns The number of columns in the field. * @param columns The number of columns in the field.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
*/ */
public public
TextField(String text, int columns) TextField(String text, int columns)
{ {
super(text); super(text);
this.columns = columns; this.columns = columns;
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
} }
/*************************************************************************/ /*************************************************************************/
......
...@@ -44,7 +44,7 @@ package java.awt.color; ...@@ -44,7 +44,7 @@ package java.awt.color;
* @author Eric Blake <ebb9@email.byu.edu> * @author Eric Blake <ebb9@email.byu.edu>
* @status updated to 1.4 * @status updated to 1.4
*/ */
public class CMMException extends Exception public class CMMException extends RuntimeException
{ {
/** /**
* Compatible with JDK 1.2+. * Compatible with JDK 1.2+.
......
...@@ -46,7 +46,7 @@ import java.io.Serializable; ...@@ -46,7 +46,7 @@ import java.io.Serializable;
* @author Rolf W. Rasmussen <rolfwr@ii.uib.no> * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
* @since 1.2 * @since 1.2
*/ */
public abstract class ColorSpace public abstract class ColorSpace implements Serializable
{ {
/** /**
* Compatible with JDK 1.2+. * Compatible with JDK 1.2+.
......
...@@ -245,7 +245,7 @@ public class ICC_Profile implements Serializable ...@@ -245,7 +245,7 @@ public class ICC_Profile implements Serializable
write(new FileOutputStream(filename)); write(new FileOutputStream(filename));
} }
public void write(OutputStream out) public void write(OutputStream out) throws IOException
{ {
throw new Error("not implemented"); throw new Error("not implemented");
} }
......
...@@ -45,7 +45,7 @@ package java.awt.color; ...@@ -45,7 +45,7 @@ package java.awt.color;
* @author Eric Blake <ebb9@email.byu.edu> * @author Eric Blake <ebb9@email.byu.edu>
* @status updated to 1.4 * @status updated to 1.4
*/ */
public class ProfileDataException extends Exception public class ProfileDataException extends RuntimeException
{ {
/** /**
* Compatible with JDK 1.2+. * Compatible with JDK 1.2+.
......
...@@ -103,6 +103,8 @@ getName() ...@@ -103,6 +103,8 @@ getName()
* Returns the contents of the clipboard. * Returns the contents of the clipboard.
* *
* @param requestor The object requesting the contents. * @param requestor The object requesting the contents.
*
* @exception IllegalStateException If the clipboard is currently unavailable
*/ */
public synchronized Transferable public synchronized Transferable
getContents(Object requestor) getContents(Object requestor)
...@@ -120,6 +122,8 @@ getContents(Object requestor) ...@@ -120,6 +122,8 @@ getContents(Object requestor)
* *
* @param contents The new clipboard contents. * @param contents The new clipboard contents.
* @param owner The new clipboard owner * @param owner The new clipboard owner
*
* @exception IllegalStateException If the clipboard is currently unavailable
*/ */
public synchronized void public synchronized void
setContents(Transferable contents, ClipboardOwner owner) setContents(Transferable contents, ClipboardOwner owner)
......
...@@ -281,6 +281,7 @@ DataFlavor(Class representationClass, String humanPresentableName) ...@@ -281,6 +281,7 @@ DataFlavor(Class representationClass, String humanPresentableName)
* *
* @exception IllegalArgumentException If the representation class * @exception IllegalArgumentException If the representation class
* specified cannot be loaded. * specified cannot be loaded.
* @exception ClassNotFoundException If the class is not loaded.
*/ */
public public
DataFlavor(String mimeType, String humanPresentableName, DataFlavor(String mimeType, String humanPresentableName,
...@@ -504,6 +505,8 @@ setHumanPresentableName(String humanPresentableName) ...@@ -504,6 +505,8 @@ setHumanPresentableName(String humanPresentableName)
* *
* @return <code>true</code> if the MIME type is equal to this object's * @return <code>true</code> if the MIME type is equal to this object's
* MIME type, <code>false</code> otherwise. * MIME type, <code>false</code> otherwise.
*
* @exception NullPointerException If mimeType is null.
*/ */
public final boolean public final boolean
isMimeTypeEqual(String mimeType) isMimeTypeEqual(String mimeType)
...@@ -652,6 +655,10 @@ isFlavorJavaFileListType() ...@@ -652,6 +655,10 @@ isFlavorJavaFileListType()
* Returns a copy of this object. * Returns a copy of this object.
* *
* @return A copy of this object. * @return A copy of this object.
*
* @exception CloneNotSupportedException If the object's class does not support
* the Cloneable interface. Subclasses that override the clone method can also
* throw this exception to indicate that an instance cannot be cloned.
*/ */
public Object public Object
clone() clone()
...@@ -813,6 +820,8 @@ normalizeMimeType(String type) ...@@ -813,6 +820,8 @@ normalizeMimeType(String type)
* Serialize this class. * Serialize this class.
* *
* @param stream The <code>ObjectOutput</code> stream to serialize to. * @param stream The <code>ObjectOutput</code> stream to serialize to.
*
* @exception IOException If an error occurs.
*/ */
public void public void
writeExternal(ObjectOutput stream) throws IOException writeExternal(ObjectOutput stream) throws IOException
...@@ -826,6 +835,10 @@ writeExternal(ObjectOutput stream) throws IOException ...@@ -826,6 +835,10 @@ writeExternal(ObjectOutput stream) throws IOException
* De-serialize this class. * De-serialize this class.
* *
* @param stream The <code>ObjectInput</code> stream to deserialize from. * @param stream The <code>ObjectInput</code> stream to deserialize from.
*
* @exception IOException If an error ocurs.
* @exception ClassNotFoundException If the class for an object being restored
* cannot be found.
*/ */
public void public void
readExternal(ObjectInput stream) throws IOException, ClassNotFoundException readExternal(ObjectInput stream) throws IOException, ClassNotFoundException
...@@ -950,6 +963,10 @@ selectBestTextFlavor(DataFlavor[] availableFlavors) ...@@ -950,6 +963,10 @@ selectBestTextFlavor(DataFlavor[] availableFlavors)
* *
* @param transferable The <code>Transferable</code> for which a text * @param transferable The <code>Transferable</code> for which a text
* <code>Reader</code> is requested. * <code>Reader</code> is requested.
*
* @exception IllegalArgumentException If the representation class is not one
* of the seven listed above or the Transferable has null data.
* @exception NullPointerException If the Transferable is null.
* @exception UnsupportedFlavorException when the transferable doesn't * @exception UnsupportedFlavorException when the transferable doesn't
* support this <code>DataFlavor</code>. Or if the representable class * support this <code>DataFlavor</code>. Or if the representable class
* isn't a (subclass of) <code>Reader</code>, <code>String</code>, * isn't a (subclass of) <code>Reader</code>, <code>String</code>,
......
...@@ -41,42 +41,35 @@ package java.awt.datatransfer; ...@@ -41,42 +41,35 @@ package java.awt.datatransfer;
import java.util.Map; import java.util.Map;
/** /**
* This interface maps between native platform type names and DataFlavors. * This interface maps between native platform type names and DataFlavors.
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public interface FlavorMap public interface FlavorMap
{ {
/**
* Maps the specified <code>DataFlavor</code> objects to the native
* data type name. The returned <code>Map</code> has keys that are
* the data flavors and values that are strings. The returned map
* may be modified. This can be useful for implementing nested mappings.
*
* @param flavors An array of data flavors to map
* or null for all data flavors.
*
* @return A <code>Map</code> of native data types.
*/
public abstract Map getNativesForFlavors (DataFlavor[] flavors);
/** /**
* Maps the specified <code>DataFlavor</code> objects to the native * Maps the specified native type names to <code>DataFlavor</code>'s.
* data type name. The returned <code>Map</code> has keys that are * The returned <code>Map</code> has keys that are strings and values
* the data flavors and values that are strings. The returned map * that are <code>DataFlavor</code>'s. The returned map may be
* may be modified. This can be useful for implementing nested mappings. * modified. This can be useful for implementing nested mappings.
* *
* @param flavors An array of data flavors to map * @param natives An array of native types to map
* or null for all data flavors. * or null for all native types.
* *
* @return A <code>Map</code> of native data types. * @return A <code>Map</code> of data flavors.
*/ */
public abstract Map public abstract Map getFlavorsForNatives (String[] natives);
getNativesForFlavors(DataFlavor[] flavors); }
/*************************************************************************/
/**
* Maps the specified native type names to <code>DataFlavor</code>'s.
* The returned <code>Map</code> has keys that are strings and values
* that are <code>DataFlavor</code>'s. The returned map may be
* modified. This can be useful for implementing nested mappings.
*
* @param natives An array of native types to map
* or null for all native types.
*
* @return A <code>Map</code> of data flavors.
*/
public abstract Map
getFlavorsForNatives(String[] natives);
} // interface FlavorMap
...@@ -40,6 +40,7 @@ package java.awt.datatransfer; ...@@ -40,6 +40,7 @@ package java.awt.datatransfer;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.List;
/** /**
* This class maps between native platform type names and DataFlavors. * This class maps between native platform type names and DataFlavors.
...@@ -47,134 +48,122 @@ import java.util.Map; ...@@ -47,134 +48,122 @@ import java.util.Map;
* XXX - The current implementation does no mapping at all. * XXX - The current implementation does no mapping at all.
* *
* @author Mark Wielaard (mark@klomp.org) * @author Mark Wielaard (mark@klomp.org)
*/
public final class SystemFlavorMap implements FlavorMap
{
/**
* The default (instance) flavor map.
*/
private static FlavorMap defaultFlavorMap;
/**
* Private constructor.
*/
private SystemFlavorMap()
{
}
/*************************************************************************/
/**
* Maps the specified <code>DataFlavor</code> objects to the native
* data type name. The returned <code>Map</code> has keys that are
* the data flavors and values that are strings. The returned map
* may be modified. This can be useful for implementing nested mappings.
*
* @param flavors An array of data flavors to map
* or null for all data flavors.
* *
* @return A <code>Map</code> of native data types to data flavors. * @since 1.2
*/
public Map
getNativesForFlavors(DataFlavor[] flavors)
{
return(new HashMap());
}
/*************************************************************************/
/**
* Maps the specified native type names to <code>DataFlavor</code>'s.
* The returned <code>Map</code> has keys that are strings and values
* that are <code>DataFlavor</code>'s. The returned map may be
* modified. This can be useful for implementing nested mappings.
*
* @param natives An array of native types to map
* or null for all native types.
*
* @return A <code>Map</code> of data flavors to native type names.
*/
public Map
getFlavorsForNatives(String[] natives)
{
return(new HashMap());
}
/*************************************************************************/
/**
* Returns the default (instance) (System)FlavorMap.
*/
public static FlavorMap
getDefaultFlavorMap()
{
if (defaultFlavorMap == null)
defaultFlavorMap = new SystemFlavorMap();
return(defaultFlavorMap);
}
/*************************************************************************/
/**
* Returns the native type name for the given java mime type.
*/
public static String
encodeJavaMIMEType(String mime)
{
return null;
}
/*************************************************************************/
/**
* Returns the native type name for the given data flavor.
*/
public static String
encodeDataFlavor(DataFlavor df)
{
return null;
}
/*************************************************************************/
/**
* Returns true if the native type name can be represented as
* a java mime type.
*/
public static boolean
isJavaMIMEType(String name)
{
return(false);
}
/*************************************************************************/
/**
* Returns the java mime type for the given the native type name.
*/ */
public static String public final class SystemFlavorMap implements FlavorMap, FlavorTable
decodeJavaMIMEType(String name)
{ {
return null; /**
} * The default (instance) flavor map.
*/
/*************************************************************************/ private static FlavorMap defaultFlavorMap;
/** /**
* Returns the data flavor given the native type name * Private constructor.
* or null when no such data flavor exists. */
*/ private SystemFlavorMap ()
public static DataFlavor {
decodeDataFlavor(String name) throws ClassNotFoundException }
{
String javaMIMEType = decodeJavaMIMEType(name); /**
if (javaMIMEType != null) * Maps the specified <code>DataFlavor</code> objects to the native
return(new DataFlavor(javaMIMEType)); * data type name. The returned <code>Map</code> has keys that are
else * the data flavors and values that are strings. The returned map
return(null); * may be modified. This can be useful for implementing nested mappings.
} *
* @param flavors An array of data flavors to map
* or null for all data flavors.
*
* @return A <code>Map</code> of native data types to data flavors.
*/
public Map getNativesForFlavors (DataFlavor[] flavors)
{
return new HashMap();
}
/**
* Maps the specified native type names to <code>DataFlavor</code>'s.
* The returned <code>Map</code> has keys that are strings and values
* that are <code>DataFlavor</code>'s. The returned map may be
* modified. This can be useful for implementing nested mappings.
*
* @param natives An array of native types to map
* or null for all native types.
*
* @return A <code>Map</code> of data flavors to native type names.
*/
public Map getFlavorsForNatives (String[] natives)
{
return new HashMap();
}
/**
* Returns the default (instance) (System)FlavorMap.
*/
public static FlavorMap getDefaultFlavorMap ()
{
if (defaultFlavorMap == null)
defaultFlavorMap = new SystemFlavorMap ();
return defaultFlavorMap;
}
/**
* Returns the native type name for the given java mime type.
*/
public static String encodeJavaMIMEType (String mime)
{
return null;
}
/**
* Returns the native type name for the given data flavor.
*/
public static String encodeDataFlavor (DataFlavor df)
{
return null;
}
/**
* Returns true if the native type name can be represented as
* a java mime type.
*/
public static boolean isJavaMIMEType (String name)
{
return false;
}
/**
* Returns the java mime type for the given the native type name.
*/
public static String decodeJavaMIMEType (String name)
{
return null;
}
/**
* Returns the data flavor given the native type name
* or null when no such data flavor exists.
*/
public static DataFlavor decodeDataFlavor (String name)
throws ClassNotFoundException
{
String javaMIMEType = decodeJavaMIMEType (name);
if (javaMIMEType != null)
return new DataFlavor (javaMIMEType);
else
return null;
}
public List getFlavorsForNative (String nat)
{
throw new Error ("Not implemented");
}
public List getNativesForFlavor (DataFlavor flav)
{
throw new Error ("Not implemented");
}
} // class SystemFlavorMap } // class SystemFlavorMap
...@@ -113,15 +113,42 @@ public class DragGestureEvent extends EventObject ...@@ -113,15 +113,42 @@ public class DragGestureEvent extends EventObject
{ {
return null; return null;
} }
/**
* Starts the drag given the initial Cursor to display, the Transferable
* object, and the DragSourceListener to use.
*
* @exception InvalidDnDOperationException If the Drag and Drop system is
* unable to initiate a drag operation, or if the user attempts to start
* a drag while an existing drag operation is still executing.
*/
public void startDrag(Cursor dragCursor, Transferable trans) public void startDrag(Cursor dragCursor, Transferable trans)
{ {
startDrag(dragCursor, null, null, trans, null); startDrag(dragCursor, null, null, trans, null);
} }
/**
* Starts the drag given the initial Cursor to display, the Transferable
* object, and the DragSourceListener to use.
*
* @exception InvalidDnDOperationException If the Drag and Drop system is
* unable to initiate a drag operation, or if the user attempts to start
* a drag while an existing drag operation is still executing.
*/
public void startDrag(Cursor dragCursor, Transferable trans, public void startDrag(Cursor dragCursor, Transferable trans,
DragSourceListener l) DragSourceListener l)
{ {
startDrag(dragCursor, null, null, trans, l); startDrag(dragCursor, null, null, trans, l);
} }
/**
* Starts the drag given the initial Cursor to display, the Transferable
* object, and the DragSourceListener to use.
*
* @exception InvalidDnDOperationException If the Drag and Drop system is
* unable to initiate a drag operation, or if the user attempts to start
* a drag while an existing drag operation is still executing.
*/
public void startDrag(Cursor dragCursor, Image dragImage, Point imageOffset, public void startDrag(Cursor dragCursor, Image dragImage, Point imageOffset,
Transferable trans, DragSourceListener l) Transferable trans, DragSourceListener l)
{ {
......
...@@ -130,6 +130,12 @@ public abstract class DragGestureRecognizer implements Serializable ...@@ -130,6 +130,12 @@ public abstract class DragGestureRecognizer implements Serializable
throw new Error("not implemented"); throw new Error("not implemented");
} }
/**
* Register a new DragGestureListener.
*
* @exception TooManyListenersException If a DragGestureListener has already
* been added.
*/
public void addDragGestureListener(DragGestureListener dgl) public void addDragGestureListener(DragGestureListener dgl)
throws TooManyListenersException throws TooManyListenersException
{ {
......
...@@ -40,6 +40,8 @@ package java.awt.dnd; ...@@ -40,6 +40,8 @@ package java.awt.dnd;
import java.awt.Component; import java.awt.Component;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
import java.awt.Image; import java.awt.Image;
import java.awt.Point; import java.awt.Point;
import java.awt.datatransfer.FlavorMap; import java.awt.datatransfer.FlavorMap;
...@@ -62,10 +64,20 @@ public class DragSource implements Serializable ...@@ -62,10 +64,20 @@ public class DragSource implements Serializable
public static final Cursor DefaultMoveNoDrop = null; public static final Cursor DefaultMoveNoDrop = null;
public static final Cursor DefaultLinkNoDrop = null; public static final Cursor DefaultLinkNoDrop = null;
/**
* Initializes the drag source.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/
public DragSource() public DragSource()
{ {
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();
} }
/**
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/
public static DragSource getDefaultDragSource() public static DragSource getDefaultDragSource()
{ {
return null; return null;
...@@ -76,6 +88,13 @@ public class DragSource implements Serializable ...@@ -76,6 +88,13 @@ public class DragSource implements Serializable
return false; return false;
} }
/**
* Start a drag, given the DragGestureEvent that initiated the drag.
*
* @exception InvalidDnDOperationException If the Drag and Drop system is
* unable to initiate a drag operation, or if the user attempts to start
* a drag while an existing drag operation is still executing.
*/
public void startDrag(DragGestureEvent trigger, Cursor dragCursor, public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
Image dragImage, Point imageOffset, Image dragImage, Point imageOffset,
Transferable trans, DragSourceListener dsl, Transferable trans, DragSourceListener dsl,
...@@ -83,6 +102,13 @@ public class DragSource implements Serializable ...@@ -83,6 +102,13 @@ public class DragSource implements Serializable
{ {
} }
/**
* Start a drag, given the DragGestureEvent that initiated the drag.
*
* @exception InvalidDnDOperationException If the Drag and Drop system is
* unable to initiate a drag operation, or if the user attempts to start
* a drag while an existing drag operation is still executing.
*/
public void startDrag(DragGestureEvent trigger, Cursor dragCursor, public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
Transferable trans, DragSourceListener dsl, Transferable trans, DragSourceListener dsl,
FlavorMap map) FlavorMap map)
...@@ -90,6 +116,13 @@ public class DragSource implements Serializable ...@@ -90,6 +116,13 @@ public class DragSource implements Serializable
startDrag(trigger, dragCursor, null, null, trans, dsl, map); startDrag(trigger, dragCursor, null, null, trans, dsl, map);
} }
/**
* Start a drag, given the DragGestureEvent that initiated the drag.
*
* @exception InvalidDnDOperationException If the Drag and Drop system is
* unable to initiate a drag operation, or if the user attempts to start
* a drag while an existing drag operation is still executing.
*/
public void startDrag(DragGestureEvent trigger, Cursor dragCursor, public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
Image dragImage, Point imageOffset, Image dragImage, Point imageOffset,
Transferable trans, DragSourceListener dsl) Transferable trans, DragSourceListener dsl)
...@@ -97,12 +130,25 @@ public class DragSource implements Serializable ...@@ -97,12 +130,25 @@ public class DragSource implements Serializable
startDrag(trigger, dragCursor, dragImage, imageOffset, trans, dsl, null); startDrag(trigger, dragCursor, dragImage, imageOffset, trans, dsl, null);
} }
/**
* Start a drag, given the DragGestureEvent that initiated the drag.
*
* @exception InvalidDnDOperationException If the Drag and Drop system is
* unable to initiate a drag operation, or if the user attempts to start
* a drag while an existing drag operation is still executing.
*/
public void startDrag(DragGestureEvent trigger, Cursor dragCursor, public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
Transferable trans, DragSourceListener dsl) Transferable trans, DragSourceListener dsl)
{ {
startDrag(trigger, dragCursor, null, null, trans, dsl, null); startDrag(trigger, dragCursor, null, null, trans, dsl, null);
} }
/**
* Creates the DragSourceContext to handle this drag.
*
* @exception IllegalArgumentException FIXME
* @exception NullPointerException If dscp, dgl, dragImage or t is null.
*/
protected DragSourceContext protected DragSourceContext
createDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge, createDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge,
Cursor cursor, Image image, Point offset, Cursor cursor, Image image, Point offset,
......
...@@ -42,10 +42,13 @@ import java.awt.Component; ...@@ -42,10 +42,13 @@ import java.awt.Component;
import java.awt.datatransfer.FlavorMap; import java.awt.datatransfer.FlavorMap;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.Serializable;
import java.util.EventListener;
import java.util.TooManyListenersException; import java.util.TooManyListenersException;
/** STUB CLASS ONLY */ /** STUB CLASS ONLY */
public class DropTarget public class DropTarget
implements DropTargetListener, EventListener, Serializable
{ {
protected static class DropTargetAutoScroller protected static class DropTargetAutoScroller
implements ActionListener implements ActionListener
...@@ -67,6 +70,9 @@ public class DropTarget ...@@ -67,6 +70,9 @@ public class DropTarget
} }
} }
// FIXME: check the correctness of default value.
private boolean isActive = false;
/** /**
* FIXME * FIXME
* *
...@@ -133,11 +139,12 @@ public class DropTarget ...@@ -133,11 +139,12 @@ public class DropTarget
public void setActive(boolean isActive) public void setActive(boolean isActive)
{ {
this.isActive = isActive;
} }
public boolean isActive() public boolean isActive()
{ {
return false; return this.isActive;
} }
/** /**
......
...@@ -109,7 +109,7 @@ public class WindowEvent extends ComponentEvent ...@@ -109,7 +109,7 @@ public class WindowEvent extends ComponentEvent
public static final int WINDOW_STATE_CHANGED = 209; public static final int WINDOW_STATE_CHANGED = 209;
/** This is the last id in the range of event ids used by this class. */ /** This is the last id in the range of event ids used by this class. */
public static final int WINDOW_LAST = 207; public static final int WINDOW_LAST = 209;
/** /**
* The other Window involved in a focus or activation change. For * The other Window involved in a focus or activation change. For
......
...@@ -84,7 +84,7 @@ public interface PathIterator ...@@ -84,7 +84,7 @@ public interface PathIterator
* (P1), and final interpolated control point (P2): * (P1), and final interpolated control point (P2):
* <pre> * <pre>
* P(t) = B(2,0)*CP + B(2,1)*P1 + B(2,2)*P2 * P(t) = B(2,0)*CP + B(2,1)*P1 + B(2,2)*P2
* 0 <= t <= 1 * 0 &lt;= t &lt;= 1
* B(n,m) = mth coefficient of nth degree Bernstein polynomial * B(n,m) = mth coefficient of nth degree Bernstein polynomial
* = C(n,m) * t^(m) * (1 - t)^(n-m) * = C(n,m) * t^(m) * (1 - t)^(n-m)
* C(n,m) = Combinations of n things, taken m at a time * C(n,m) = Combinations of n things, taken m at a time
...@@ -100,7 +100,7 @@ public interface PathIterator ...@@ -100,7 +100,7 @@ public interface PathIterator
* (P2), and final interpolated control point (P3): * (P2), and final interpolated control point (P3):
* <pre> * <pre>
* P(t) = B(3,0)*CP + B(3,1)*P1 + B(3,2)*P2 + B(3,3)*P3 * P(t) = B(3,0)*CP + B(3,1)*P1 + B(3,2)*P2 + B(3,3)*P3
* 0 <= t <= 1 * 0 &lt;= t &lt;= 1
* B(n,m) = mth coefficient of nth degree Bernstein polynomial * B(n,m) = mth coefficient of nth degree Bernstein polynomial
* = C(n,m) * t^(m) * (1 - t)^(n-m) * = C(n,m) * t^(m) * (1 - t)^(n-m)
* C(n,m) = Combinations of n things, taken m at a time * C(n,m) = Combinations of n things, taken m at a time
......
...@@ -178,7 +178,7 @@ public class InputMethodHighlight ...@@ -178,7 +178,7 @@ public class InputMethodHighlight
* @return the style map * @return the style map
* @since 1.3 * @since 1.3
*/ */
public Map getSytle() public Map getStyle()
{ {
return style; return style;
} }
......
...@@ -97,7 +97,7 @@ public class PipedOutputStream extends OutputStream ...@@ -97,7 +97,7 @@ public class PipedOutputStream extends OutputStream
*/ */
public void connect(PipedInputStream sink) throws IOException public void connect(PipedInputStream sink) throws IOException
{ {
if (sink != null) if (this.sink != null || sink.source != null)
throw new IOException ("Already connected"); throw new IOException ("Already connected");
sink.connect(this); sink.connect(this);
} }
......
...@@ -100,7 +100,7 @@ public class PipedWriter extends Writer ...@@ -100,7 +100,7 @@ public class PipedWriter extends Writer
*/ */
public void connect(PipedReader sink) throws IOException public void connect(PipedReader sink) throws IOException
{ {
if (sink != null) if (this.sink != null || sink.source != null)
throw new IOException ("Already connected"); throw new IOException ("Already connected");
sink.connect(this); sink.connect(this);
} }
......
...@@ -172,7 +172,7 @@ public class RMIClassLoader ...@@ -172,7 +172,7 @@ public class RMIClassLoader
} }
} }
return loader != null ? loader.loadClass(name) : Class.forName(name); return loader.loadClass(name);
} }
public static String getClassAnnotation(Class cl) public static String getClassAnnotation(Class cl)
......
/* RMIClassLoaderSpi.java
Copyright (c) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.rmi.server;
import java.net.MalformedURLException;
/**
* @author Michael Koch
* @since 1.4
*/
public abstract class RMIClassLoaderSpi
{
public RMIClassLoaderSpi()
{
}
public abstract Class loadClass (String codeBase, String name,
ClassLoader defaultLoader)
throws MalformedURLException, ClassNotFoundException;
public abstract Class loadProxyClass (String codeBase, String[] interfaces,
ClassLoader defaultLoader)
throws MalformedURLException, ClassNotFoundException;
public abstract ClassLoader getClassLoader (String codebase)
throws MalformedURLException;
public abstract String getClassAnnotation (Class cl);
}
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