Makefile.in: Rebuilt.
authorTom Tromey <tromey@redhat.com>
Thu, 2 Jan 2003 00:14:24 +0000 (00:14 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 2 Jan 2003 00:14:24 +0000 (00:14 +0000)
* 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

43 files changed:
libjava/ChangeLog
libjava/Makefile.am
libjava/Makefile.in
libjava/gnu/awt/j2d/Graphics2DImpl.java
libjava/java/awt/AlphaComposite.java
libjava/java/awt/BasicStroke.java
libjava/java/awt/BufferCapabilities.java
libjava/java/awt/Button.java
libjava/java/awt/CheckboxMenuItem.java
libjava/java/awt/Choice.java
libjava/java/awt/Container.java
libjava/java/awt/Cursor.java
libjava/java/awt/EventQueue.java
libjava/java/awt/FileDialog.java
libjava/java/awt/Graphics2D.java
libjava/java/awt/Label.java
libjava/java/awt/Menu.java
libjava/java/awt/MenuBar.java
libjava/java/awt/MenuComponent.java
libjava/java/awt/PopupMenu.java
libjava/java/awt/ScrollPane.java
libjava/java/awt/Scrollbar.java
libjava/java/awt/TextArea.java
libjava/java/awt/TextField.java
libjava/java/awt/color/CMMException.java
libjava/java/awt/color/ColorSpace.java
libjava/java/awt/color/ICC_Profile.java
libjava/java/awt/color/ProfileDataException.java
libjava/java/awt/datatransfer/Clipboard.java
libjava/java/awt/datatransfer/DataFlavor.java
libjava/java/awt/datatransfer/FlavorMap.java
libjava/java/awt/datatransfer/SystemFlavorMap.java
libjava/java/awt/dnd/DragGestureEvent.java
libjava/java/awt/dnd/DragGestureRecognizer.java
libjava/java/awt/dnd/DragSource.java
libjava/java/awt/dnd/DropTarget.java
libjava/java/awt/event/WindowEvent.java
libjava/java/awt/geom/PathIterator.java
libjava/java/awt/im/InputMethodHighlight.java
libjava/java/io/PipedOutputStream.java
libjava/java/io/PipedWriter.java
libjava/java/rmi/server/RMIClassLoader.java
libjava/java/rmi/server/RMIClassLoaderSpi.java [new file with mode: 0644]

index 8f58e13f938884a2a6dac7e9468b226979ce0ae7..1d3d4bd603043926088c01c212e3ffd9c9e7653e 100644 (file)
@@ -1,3 +1,34 @@
+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>
 
        Fix for PR libgcj/7416:
index cbacaf3f77f8ff57e1f85bfe9a2ffbf94fe3d475..e9f52f94cd7eb00f72bef65c74d195b39e0b59eb 100644 (file)
@@ -1336,6 +1336,7 @@ java/rmi/server/LogStream.java \
 java/rmi/server/ObjID.java \
 java/rmi/server/Operation.java \
 java/rmi/server/RMIClassLoader.java \
+java/rmi/server/RMIClassLoaderSpi.java \
 java/rmi/server/RMIClientSocketFactory.java \
 java/rmi/server/RMIFailureHandler.java \
 java/rmi/server/RMIServerSocketFactory.java \
index 295fd893b4cbc1db45cfefb508d1c70d4626ea72..595c24fbfe7daa25cf48a389d2a3cc5bcccb2e73 100644 (file)
@@ -1096,6 +1096,7 @@ java/rmi/server/LogStream.java \
 java/rmi/server/ObjID.java \
 java/rmi/server/Operation.java \
 java/rmi/server/RMIClassLoader.java \
+java/rmi/server/RMIClassLoaderSpi.java \
 java/rmi/server/RMIClientSocketFactory.java \
 java/rmi/server/RMIFailureHandler.java \
 java/rmi/server/RMIServerSocketFactory.java \
@@ -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/ObjID.P .deps/java/rmi/server/Operation.P \
 .deps/java/rmi/server/RMIClassLoader.P \
+.deps/java/rmi/server/RMIClassLoaderSpi.P \
 .deps/java/rmi/server/RMIClientSocketFactory.P \
 .deps/java/rmi/server/RMIFailureHandler.P \
 .deps/java/rmi/server/RMIServerSocketFactory.P \
index ef4d742c056ebaf3c81dd02b7de8c0f832c6f67b..5af41bfc9cb4c8b26b2c623d31c1216362facf55 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002  Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -24,6 +24,7 @@ import java.awt.Stroke;
 import java.awt.geom.AffineTransform;
 import java.awt.image.ImageObserver;
 import java.awt.image.BufferedImage;
+import java.awt.image.BufferedImageOp;
 import java.awt.image.RenderedImage;
 import java.awt.image.renderable.RenderableImage;
 import java.text.AttributedCharacterIterator;
@@ -459,7 +460,7 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
     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");  
   }
index 14649fc74a39ccd97fd002d6ee088c5eebfaffe3..f0795a9601074ed7c576a8f59e510af1c47b184b 100644 (file)
@@ -64,6 +64,7 @@ public final class AlphaComposite implements Composite
       return size() > MAX_CACHE_SIZE;
     }
   };
+
   public static final int CLEAR = 1;
   public static final int SRC = 2;
   public static final int DST = 9;
@@ -88,6 +89,7 @@ public final class AlphaComposite implements Composite
   public static final AlphaComposite SrcAtop = getInstance(SRC_ATOP);
   public static final AlphaComposite DstAtop = getInstance(DST_ATOP);
   public static final AlphaComposite Xor = getInstance(XOR);
+  
   private final int rule;
   private final float alpha;
   private AlphaComposite(int rule, float alpha)
@@ -95,10 +97,32 @@ public final class AlphaComposite implements Composite
     this.rule = rule;
     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)
   {
     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)
   {
     if (rule < CLEAR || rule > XOR || ! (alpha >= 0 && alpha <= 1))
index c3290336cd9bfab4c44a012e5cdde03b36aae884..3d0a2e7450627c4c168524a5f76f72096aa911b4 100644 (file)
@@ -1,5 +1,5 @@
 /* BasicStroke.java -- 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -59,12 +59,31 @@ public class BasicStroke implements Stroke
   private final float[] dash;
   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,
                      float[] dash, float dashPhase)
   {
-    if (width < 0 || miterlimit < 1 || cap < CAP_BUTT || cap > CAP_SQUARE
-        || join < JOIN_MITER || join > JOIN_BEVEL)
+    if (width < 0 ||
+        miterlimit < 1.0f ||
+        cap < CAP_BUTT ||
+        cap > CAP_SQUARE ||
+        join < JOIN_MITER ||
+        join > JOIN_BEVEL)
       throw new IllegalArgumentException();
+
     this.width = width;
     this.cap = cap;
     this.join = join;
@@ -73,21 +92,54 @@ public class BasicStroke implements Stroke
     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)
   {
     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)
   {
     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)
   {
     this(width, CAP_SQUARE, JOIN_MITER, 10, null, 0);
   }
 
+  /**
+   * Creates a basic stroke.
+   */
   public BasicStroke()
   {
     this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0);
index 389594b76b57ff4f1f0c9ab18b667dd7bef74427..871529e6e939c60546fe9ff9c8a1d1c5a35882d2 100644 (file)
@@ -67,6 +67,11 @@ public class BufferCapabilities implements Cloneable
   private final ImageCapabilities back;
   private final FlipContents flip;
 
+  /**
+   * Creates a buffer capabilities object.
+   *
+   * @exception IllegalArgumentException If frontCaps or backCaps are null.
+   */
   public BufferCapabilities(ImageCapabilities front, ImageCapabilities back,
                             FlipContents flip)
   {
index ed954ddcfda83b2e4feb6db3d47f04523408f16f..989fbc951730756be5ad9cfa5228150002129e2b 100644 (file)
@@ -90,6 +90,9 @@ private transient ActionListener action_listeners;
 
 /**
   * Initializes a new instance of <code>Button</code> with no label.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+  * returns true
   */
 public
 Button()
@@ -104,12 +107,18 @@ Button()
   * label.  The action command name is also initialized to this value.
   *
   * @param label The label to display on the button.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+  * returns true
   */
 public
 Button(String label)
 {
   this.label = label;
   actionCommand = label;
+
+  if (GraphicsEnvironment.isHeadless ())
+    throw new HeadlessException ();
 }
 
 /*************************************************************************/
@@ -211,6 +220,10 @@ removeActionListener(ActionListener listener)
 /** Returns all registered EventListers of the given listenerType. 
  * listenerType must be a subclass of EventListener, or a 
  * ClassClassException is thrown.
+ *
+ * @exception ClassCastException If listenerType doesn't specify a class or
+ * interface that implements @see java.util.EventListener.
+ *
  * @since 1.3 
  */
   public EventListener[] getListeners(Class listenerType)
index 2f7ecd79fc5efa34a3fb587930ca96df46fb1338..88218397c3c613dd18b8e0931d4d9d2020545372 100644 (file)
@@ -84,6 +84,9 @@ private transient ItemListener item_listeners;
 /**
   * Initializes a new instance of <code>CheckboxMenuItem</code> with no
   * label and an initial state of off.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+  * returns true.
   */
 public
 CheckboxMenuItem()
@@ -98,6 +101,9 @@ CheckboxMenuItem()
   * specified label and an initial state of off.
   *
   * @param label The label of the menu item.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+  * returns true.
   */
 public
 CheckboxMenuItem(String label)
@@ -114,12 +120,18 @@ CheckboxMenuItem(String label)
   * @param label The label of the menu item.
   * @param state The initial state of the menu item, where <code>true</code>
   * is on, and <code>false</code> is off.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+  * returns true.
   */
 public
 CheckboxMenuItem(String label, boolean state)
 {
   super(label);
   this.state = state;
+
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
 }
 
 /*************************************************************************/
index 81a2a31c932f446d81b35697d3fbd1c59b4a8666..4c7b505535cafd088df72e3a050d229e96ab4afd 100644 (file)
@@ -85,13 +85,17 @@ private ItemListener item_listeners;
  * Constructors
  */
 
-/**
-  * Initializes a new instance of <code>Choice</code>.
-  */
-public
-Choice()
-{
-}
+  /**
+   * Initializes a new instance of <code>Choice</code>.
+   *
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+   * returns true
+   */
+  public Choice()
+  {
+    if (GraphicsEnvironment.isHeadless())
+      throw new HeadlessException ();
+  }
 
 /*************************************************************************/
 
@@ -146,12 +150,16 @@ getItem(int index)
   * Adds the specified item to this choice box.
   *
   * @param item The item to add.
+  *
+  * @exception NullPointerException If the item's value is null
+  *
+  * @since 1.1
   */
 public synchronized void
 add(String item)
 {
   if (item == null)
-    throw new IllegalArgumentException ("item must be non-null");
+    throw new NullPointerException ("item must be non-null");
 
   pItems.addElement(item);
 
@@ -171,7 +179,12 @@ add(String item)
 /**
   * 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.
+  *
+  * @exception NullPointerException If the item's value is equal to null
   */
 public synchronized void
 addItem(String item)
@@ -189,10 +202,15 @@ addItem(String item)
  *
  * @param item The item to add.
  * @param index The index at which the item should be inserted.
+ *
+ * @exception IllegalArgumentException If index is less than 0
  */
 public synchronized void
 insert(String item, int index)
 {
+  if (index < 0)
+    throw new IllegalArgumentException ("index may not be less then 0");
+
   if (index > getItemCount ())
     index = getItemCount ();
 
index dd2390d35ba0458c1ad0bb52e034eea1334e4848..9494d8c56aca74df7f4bd24cfb952d6f69a76c59 100644 (file)
@@ -59,7 +59,9 @@ import javax.accessibility.Accessible;
  *
  * @author original author unknown
  * @author Eric Blake <ebb9@email.byu.edu>
+ *
  * @since 1.0
+ *
  * @status still missing 1.4 support
  */
 public class Container extends Component
@@ -78,7 +80,9 @@ public class Container extends Component
 
   Dimension maxSize;
 
-  /** @since 1.4 */
+  /**
+   * @since 1.4
+   */
   boolean focusCycleRoot;
 
   int containerSerializedDataVersion;
@@ -107,6 +111,7 @@ public class Container extends Component
    * Returns the number of components in this container.
    *
    * @return The number of components in this container.
+   *
    * @deprecated use {@link #getComponentCount()} instead
    */
   public int countComponents()
@@ -118,16 +123,19 @@ public class Container extends Component
    * Returns the component at the specified index.
    *
    * @param index The index of the component to retrieve.
+   *
    * @return The requested component.
+   *
    * @throws ArrayIndexOutOfBoundsException If the specified index is invalid
    */
   public Component getComponent(int n)
   {
     synchronized (getTreeLock ())
       {
-       if (n < 0 || n >= ncomponents)
-         throw new ArrayIndexOutOfBoundsException("no such component");
-       return component[n];
+        if (n < 0 || n >= ncomponents)
+          throw new ArrayIndexOutOfBoundsException("no such component");
+
+        return component[n];
       }
   }
 
@@ -140,10 +148,12 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       Component[] result = new Component[ncomponents];
-       if (ncomponents > 0)
-         System.arraycopy(component, 0, result, 0, ncomponents);
-       return result;
+        Component[] result = new Component[ncomponents];
+
+        if (ncomponents > 0)
+          System.arraycopy(component, 0, result, 0, ncomponents);
+
+        return result;
       }
   }
 
@@ -157,6 +167,7 @@ public class Container extends Component
   {
     if (peer == null)
       return new Insets(0, 0, 0, 0);
+    
     return ((ContainerPeer) peer).getInsets();
   }
 
@@ -177,6 +188,7 @@ public class Container extends Component
    * component list.
    *
    * @param component The component to add to the container.
+   *
    * @return The same component that was added.
    */
   public Component add(Component comp)
@@ -190,7 +202,7 @@ public class Container extends Component
    * component list.  This method should not be used. Instead, use
    * <code>add(Component, Object</code>.
    *
-   * @param name FIXME
+   * @param name The name of the component to be added.
    * @param component The component to be added.
    *
    * @return The same component that was added.
@@ -268,69 +280,70 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       if (index > ncomponents
-           || (index < 0 && index != -1)
-           || comp instanceof Window
-           || (comp instanceof Container
-               && ((Container) comp).isAncestorOf(this)))
-         throw new IllegalArgumentException();
-
-       // Reparent component, and make sure component is instantiated if
-       // we are.
-       if (comp.parent != null)
-         comp.parent.remove(comp);
-       comp.parent = this;
-       if (peer != null)
-         {
-           comp.addNotify();
-
-           if (comp.isLightweight())
-             enableEvents(comp.eventMask);
-         }
+        if (index > ncomponents
+            || (index < 0 && index != -1)
+            || comp instanceof Window
+            || (comp instanceof Container
+                && ((Container) comp).isAncestorOf(this)))
+          throw new IllegalArgumentException();
+
+        // Reparent component, and make sure component is instantiated if
+        // we are.
+        if (comp.parent != null)
+          comp.parent.remove(comp);
+        comp.parent = this;
+        if (peer != null)
+          {
+            comp.addNotify();
 
-       invalidate();
+            if (comp.isLightweight())
+              enableEvents(comp.eventMask);
+          }
 
-       if (component == null)
-         component = new Component[4]; // FIXME, better initial size?
+        invalidate();
 
-       // This isn't the most efficient implementation.  We could do less
-       // copying when growing the array.  It probably doesn't matter.
-       if (ncomponents >= component.length)
-         {
-           int nl = component.length * 2;
-           Component[] c = new Component[nl];
-           System.arraycopy(component, 0, c, 0, ncomponents);
-           component = c;
-         }
-       if (index == -1)
-         component[ncomponents++] = comp;
-       else
-         {
-           System.arraycopy(component, index, component, index + 1,
-                            ncomponents - index);
-           component[index] = comp;
-           ++ncomponents;
-         }
+        if (component == null)
+          component = new Component[4]; // FIXME, better initial size?
 
-       // Notify the layout manager.
-       if (layoutMgr != null)
-         {
-           if (layoutMgr instanceof LayoutManager2)
-             {
-               LayoutManager2 lm2 = (LayoutManager2) layoutMgr;
-               lm2.addLayoutComponent(comp, constraints);
-             }
-           else if (constraints instanceof String)
-             layoutMgr.addLayoutComponent((String) constraints, comp);
-           else
-             layoutMgr.addLayoutComponent(null, comp);
-         }
+        // This isn't the most efficient implementation.  We could do less
+        // copying when growing the array.  It probably doesn't matter.
+        if (ncomponents >= component.length)
+          {
+            int nl = component.length * 2;
+            Component[] c = new Component[nl];
+            System.arraycopy(component, 0, c, 0, ncomponents);
+            component = c;
+          }
+  
+        if (index == -1)
+          component[ncomponents++] = comp;
+        else
+          {
+            System.arraycopy(component, index, component, index + 1,
+                             ncomponents - index);
+            component[index] = comp;
+            ++ncomponents;
+          }
 
-       // Post event to notify of adding the container.
-       ContainerEvent ce = new ContainerEvent(this,
-                                              ContainerEvent.COMPONENT_ADDED,
-                                              comp);
-       getToolkit().getSystemEventQueue().postEvent(ce);
+        // Notify the layout manager.
+        if (layoutMgr != null)
+          {
+            if (layoutMgr instanceof LayoutManager2)
+              {
+                LayoutManager2 lm2 = (LayoutManager2) layoutMgr;
+                lm2.addLayoutComponent(comp, constraints);
+              }
+            else if (constraints instanceof String)
+              layoutMgr.addLayoutComponent((String) constraints, comp);
+            else
+              layoutMgr.addLayoutComponent(null, comp);
+          }
+
+        // Post event to notify of adding the container.
+        ContainerEvent ce = new ContainerEvent(this,
+                                               ContainerEvent.COMPONENT_ADDED,
+                                               comp);
+        getToolkit().getSystemEventQueue().postEvent(ce);
       }
   }
 
@@ -343,24 +356,24 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       Component r = component[index];
+        Component r = component[index];
 
-       r.removeNotify();
+        r.removeNotify();
 
-       System.arraycopy(component, index + 1, component, index,
-                        ncomponents - index - 1);
-       component[--ncomponents] = null;
+        System.arraycopy(component, index + 1, component, index,
+                         ncomponents - index - 1);
+        component[--ncomponents] = null;
 
-       invalidate();
+        invalidate();
 
-       if (layoutMgr != null)
-         layoutMgr.removeLayoutComponent(r);
+        if (layoutMgr != null)
+          layoutMgr.removeLayoutComponent(r);
 
-       // Post event to notify of adding the container.
-       ContainerEvent ce = new ContainerEvent(this,
-                                              ContainerEvent.COMPONENT_REMOVED,
-                                              r);
-       getToolkit().getSystemEventQueue().postEvent(ce);
+        // Post event to notify of adding the container.
+        ContainerEvent ce = new ContainerEvent(this,
+                                               ContainerEvent.COMPONENT_REMOVED,
+                                               r);
+        getToolkit().getSystemEventQueue().postEvent(ce);
       }
   }
 
@@ -373,14 +386,14 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       for (int i = 0; i < ncomponents; ++i)
-         {
-           if (component[i] == comp)
-             {
-               remove(i);
-               break;
-             }
-         }
+        for (int i = 0; i < ncomponents; ++i)
+          {
+            if (component[i] == comp)
+              {
+                remove(i);
+                break;
+              }
+          }
       }
   }
 
@@ -391,8 +404,8 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       while (ncomponents > 0)
-         remove(0);
+        while (ncomponents > 0)
+          remove(0);
       }
   }
 
@@ -525,6 +538,7 @@ public class Container extends Component
    * Returns the preferred size of this container.
    *
    * @return The preferred size of this container.
+   *
    * @deprecated use {@link #getPreferredSize()} instead
    */
   public Dimension preferredSize()
@@ -549,6 +563,7 @@ public class Container extends Component
    * Returns the minimum size of this container.
    *
    * @return The minimum size of this container.
+   *
    * @deprecated use {@link #getMinimumSize()} instead
    */
   public Dimension minimumSize()
@@ -709,6 +724,10 @@ public class Container extends Component
   }
 
   /**
+   * Returns an array of all the objects currently registered as FooListeners
+   * upon this Container. FooListeners are registered using the addFooListener
+   * method.
+   *
    * @since 1.3
    */
   public EventListener[] getListeners(Class listenerType)
@@ -760,6 +779,7 @@ public class Container extends Component
    * AWT 1.0 event processor.
    *
    * @param event The event that occurred.
+   *
    * @deprecated use {@link #dispatchEvent(AWTEvent)} instead
    */
   public void deliverEvent(Event e)
@@ -784,20 +804,20 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       if (! contains(x, y))
-         return null;
-       for (int i = 0; i < ncomponents; ++i)
-         {
-           // Ignore invisible children...
-           if (!component[i].isVisible())
-             continue;
-
-           int x2 = x - component[i].x;
-           int y2 = y - component[i].y;
-           if (component[i].contains(x2, y2))
-             return component[i];
-         }
-       return this;
+        if (! contains(x, y))
+          return null;
+        for (int i = 0; i < ncomponents; ++i)
+          {
+            // Ignore invisible children...
+            if (!component[i].isVisible())
+              continue;
+
+            int x2 = x - component[i].x;
+            int y2 = y - component[i].y;
+            if (component[i].contains(x2, y2))
+              return component[i];
+          }
+        return this;
       }
   }
 
@@ -813,6 +833,7 @@ public class Container extends Component
    *
    * @return The component containing the specified point, or <code>null</code>
    * if there is no such point.
+   *
    * @deprecated use {@link #getComponentAt(int, int)} instead
    */
   public Component locate(int x, int y)
@@ -841,31 +862,31 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       if (! contains(x, y))
-         return null;
-
-       for (int i = 0; i < ncomponents; ++i)
-         {
-           // Ignore invisible children...
-           if (!component[i].isVisible())
-             continue;
-
-           int x2 = x - component[i].x;
-           int y2 = y - component[i].y;
-           // We don't do the contains() check right away because
-           // findComponentAt would redundantly do it first thing.
-           if (component[i] instanceof Container)
-             {
-               Container k = (Container) component[i];
-               Component r = k.findComponentAt(x2, y2);
-               if (r != null)
-                 return r;
-             }
-           else if (component[i].contains(x2, y2))
-             return component[i];
-         }
+        if (! contains(x, y))
+          return null;
 
-       return this;
+        for (int i = 0; i < ncomponents; ++i)
+          {
+            // Ignore invisible children...
+            if (!component[i].isVisible())
+              continue;
+
+            int x2 = x - component[i].x;
+            int y2 = y - component[i].y;
+            // We don't do the contains() check right away because
+            // findComponentAt would redundantly do it first thing.
+            if (component[i] instanceof Container)
+              {
+                Container k = (Container) component[i];
+                Component r = k.findComponentAt(x2, y2);
+                if (r != null)
+                  return r;
+              }
+            else if (component[i].contains(x2, y2))
+              return component[i];
+          }
+
+        return this;
       }
   }
 
@@ -894,9 +915,9 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       for (int i = 0; i < ncomponents; ++i)
-         component[i].removeNotify();
-       super.removeNotify();
+        for (int i = 0; i < ncomponents; ++i)
+          component[i].removeNotify();
+        super.removeNotify();
       }
   }
 
@@ -913,14 +934,14 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       while (true)
-         {
-           if (comp == null)
-             return false;
-           if (comp == this)
-             return true;
-           comp = comp.getParent();
-         }
+        while (true)
+          {
+            if (comp == null)
+              return false;
+            if (comp == this)
+              return true;
+            comp = comp.getParent();
+          }
       }
   }
 
@@ -950,9 +971,9 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       super.list(out, indent);
-       for (int i = 0; i < ncomponents; ++i)
-         component[i].list(out, indent + 2);
+        super.list(out, indent);
+        for (int i = 0; i < ncomponents; ++i)
+          component[i].list(out, indent + 2);
       }
   }
 
@@ -967,62 +988,93 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       super.list(out, indent);
-       for (int i = 0; i < ncomponents; ++i)
-         component[i].list(out, indent + 2);
+        super.list(out, indent);
+        for (int i = 0; i < ncomponents; ++i)
+          component[i].list(out, indent + 2);
       }
   }
 
   public void setFocusTraversalKeys(int id, Set keys)
   {
+    if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
+      throw new IllegalArgumentException ();
   }
+  
   public Set getFocusTraversalKeys(int id)
   {
+    if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
+      throw new IllegalArgumentException ();
+
     return null;
   }
+  
   public boolean areFocusTraversalKeysSet(int id)
   {
+    if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS &&
+        id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS)
+      throw new IllegalArgumentException ();
+
     return false;
   }
+  
   public boolean isFocusCycleRoot(Container c)
   {
     return false;
   }
+  
   public void transferFocusBackward()
   {
   }
+  
   public void setFocusTraversalPolicy(FocusTraversalPolicy policy)
   {
   }
+  
   public FocusTraversalPolicy getFocusTraversalPolicy()
   {
     return null;
   }
+  
   public boolean isFocusTraversalPolicySet()
   {
     return false;
   }
+  
   public void setFocusCycleRoot(boolean focusCycleRoot)
   {
   }
+  
   public boolean isFocusCycleRoot()
   {
     return false;
   }
+  
   public void transferFocusDownCycle()
   {
   }
+  
   public void applyComponentOrientation(ComponentOrientation o)
   {
+    if (orientation == null)
+      throw new NullPointerException ();
   }
+  
   public void addPropertyChangeListener(PropertyChangeListener l)
   {
   }
+  
   public void addPropertyChangeListener(String name, PropertyChangeListener l)
   {
   }
 
-\f
   // Hidden helper methods.
 
   /**
@@ -1044,14 +1096,14 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       for (int i = 0; i < ncomponents; ++i)
-         {
-           Component comp = component[i];
-           boolean applicable = comp.isVisible()
-             && (comp.isLightweight() || !lightweightOnly);
-
-           if (applicable)
-             visitChild(gfx, visitor, comp);
+        for (int i = 0; i < ncomponents; ++i)
+          {
+            Component comp = component[i];
+            boolean applicable = comp.isVisible()
+              && (comp.isLightweight() || !lightweightOnly);
+
+            if (applicable)
+              visitChild(gfx, visitor, comp);
          }
       }
   }
@@ -1100,50 +1152,50 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       int start, end;
-       if (child != null)
-         {
-           for (start = 0; start < ncomponents; ++start)
-             {
-               if (component[start] == child)
-                 break;
-             }
-           end = start;
-           // This special case lets us be sure to terminate.
-           if (end == 0)
-             end = ncomponents;
-           ++start;
-         }
-       else
-         {
-           start = 0;
-           end = ncomponents;
-         }
+        int start, end;
+        if (child != null)
+          {
+            for (start = 0; start < ncomponents; ++start)
+              {
+                if (component[start] == child)
+                  break;
+              }
+            end = start;
+            // This special case lets us be sure to terminate.
+            if (end == 0)
+              end = ncomponents;
+            ++start;
+          }
+        else
+          {
+            start = 0;
+            end = ncomponents;
+          }
 
-       for (int j = start; j != end; ++j)
-         {
-           if (j >= ncomponents)
-             {
-               // The JCL says that we should wrap here.  However, that
-               // seems wrong.  To me it seems that focus order should be
-               // global within in given window.  So instead if we reach
-               // the end we try to look in our parent, if we have one.
-               if (parent != null)
-                 return parent.findNextFocusComponent(this);
-               j -= ncomponents;
-             }
-           if (component[j] instanceof Container)
-             {
-               Component c = component[j];
-               c = c.findNextFocusComponent(null);
-               if (c != null)
-                 return c;
-             }
-           else if (component[j].isFocusTraversable())
-             return component[j];
-         }
+        for (int j = start; j != end; ++j)
+          {
+            if (j >= ncomponents)
+              {
+                // The JCL says that we should wrap here.  However, that
+                // seems wrong.  To me it seems that focus order should be
+                // global within in given window.  So instead if we reach
+                // the end we try to look in our parent, if we have one.
+                if (parent != null)
+                  return parent.findNextFocusComponent(this);
+                j -= ncomponents;
+              }
+            if (component[j] instanceof Container)
+              {
+                Component c = component[j];
+                c = c.findNextFocusComponent(null);
+                if (c != null)
+                  return c;
+              }
+            else if (component[j].isFocusTraversable())
+              return component[j];
+          }
 
-       return null;
+        return null;
       }
   }
 
@@ -1151,16 +1203,15 @@ public class Container extends Component
   {
     synchronized (getTreeLock ())
       {
-       for (int i = ncomponents;  --i >= 0; )
-         {
-           component[i].addNotify();
-           if (component[i].isLightweight())
-             enableEvents(component[i].eventMask);
-         }
+        for (int i = ncomponents;  --i >= 0; )
+          {
+            component[i].addNotify();
+            if (component[i].isLightweight())
+              enableEvents(component[i].eventMask);
+          }
       }
   }
 
-\f
   // Nested classes.
 
   /* The following classes are used in concert with the
@@ -1200,6 +1251,7 @@ public class Container extends Component
    * This class provides accessibility support for subclasses of container.
    *
    * @author Eric Blake <ebb9@email.byu.edu>
+   *
    * @since 1.3
    */
   protected class AccessibleAWTContainer extends AccessibleAWTComponent
@@ -1234,14 +1286,14 @@ public class Container extends Component
     public int getAccessibleChildrenCount()
     {
       synchronized (getTreeLock ())
-       {
-         int count = 0;
-         int i = component == null ? 0 : component.length;
-         while (--i >= 0)
-           if (component[i] instanceof Accessible)
-             count++;
-         return count;
-       }
+        {
+          int count = 0;
+          int i = component == null ? 0 : component.length;
+          while (--i >= 0)
+            if (component[i] instanceof Accessible)
+              count++;
+          return count;
+        }
     }
 
     /**
@@ -1253,17 +1305,17 @@ public class Container extends Component
     public Accessible getAccessibleChild(int i)
     {
       synchronized (getTreeLock ())
-       {
-         if (component == null)
-           return null;
-         int index = -1;
-         while (i >= 0 && ++index < component.length)
-           if (component[index] instanceof Accessible)
-             i--;
-         if (i < 0)
-           return (Accessible) component[index];
-         return null;
-       }
+        {
+          if (component == null)
+            return null;
+          int index = -1;
+          while (i >= 0 && ++index < component.length)
+            if (component[index] instanceof Accessible)
+              i--;
+          if (i < 0)
+            return (Accessible) component[index];
+          return null;
+        }
     }
 
     /**
@@ -1271,7 +1323,9 @@ public class Container extends Component
      * coordinates), if one exists.
      *
      * @param p the point to look at
+     *
      * @return an accessible object at that point, or null
+     *
      * @throws NullPointerException if p is null
      */
     public Accessible getAccessibleAt(Point p)
@@ -1286,6 +1340,7 @@ public class Container extends Component
      * when children are added or removed from the enclosing accessible object.
      *
      * @author Eric Blake <ebb9@email.byu.edu>
+     *
      * @since 1.3
      */
     protected class AccessibleContainerHandler implements ContainerListener
@@ -1324,7 +1379,6 @@ public class Container extends Component
   } // class AccessibleAWTPanel
 } // class Container
 
-\f
 /**
  * Undocumented helper class.
  * STUBBED
@@ -1339,39 +1393,50 @@ class LightweightDispatcher implements Serializable, AWTEventListener
   private transient boolean isMouseInNativeContainer;
   private Cursor nativeCursor;
   private long eventMask;
+  
   LightweightDispatcher(Container c)
   {
   }
+
   void dispose()
   {
   }
+
   void enableEvents(long l)
   {
   }
+
   boolean dispatchEvent(AWTEvent e)
   {
     return true;
   }
+
   boolean isMouseGrab(MouseEvent e)
   {
     return true;
   }
+
   boolean processMouseEvent(MouseEvent e)
   {
     return true;
   }
+
   void trackMouseEnterExit(Component c, MouseEvent e)
   {
   }
+
   void startListeningForOtherDrags()
   {
   }
+
   void stopListeningForOtherDrags()
   {
   }
+
   public void eventDispatched(AWTEvent e)
   {
   }
+
   void retargetMouseEvent(Component c, int i, MouseEvent e)
   {
   }
index 5852b8bbf855acd7c0513dfe46f2381ffa3c05b5..8652a1e5ebe0b0eddf21927d114b9bf4fad8498c 100644 (file)
@@ -133,11 +133,14 @@ public class Cursor implements java.io.Serializable
    * type.
    *
    * @param type The cursor type.
+   *
+   * @exception IllegalArgumentException If the specified cursor type is invalid
    */
   public Cursor(int type)
   {
     if (type < 0 || type >= PREDEFINED_COUNT)
       throw new IllegalArgumentException ("invalid cursor " + type);
+
     this.type = type;
     // FIXME: lookup and set name?
   }
@@ -171,9 +174,20 @@ public class Cursor implements java.io.Serializable
     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)
                                       throws AWTException
   {
+    if (GraphicsEnvironment.isHeadless())
+      throw new HeadlessException ();
+
     // FIXME
     return null;
   }
index 1ce3d16318150bac862f1162839636dba8291ae7..6b64fb7ee3b950c56d1ee14828d55e52f5ff6107 100644 (file)
@@ -151,6 +151,8 @@ public class EventQueue
    * Posts a new event to the queue.
    *
    * @param event The event to post to the queue.
+   *
+   * @exception NullPointerException If event is null.
    */
   public synchronized void postEvent(AWTEvent evt)
   {
@@ -209,7 +211,19 @@ public class EventQueue
     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)
     throws InterruptedException, InvocationTargetException
   {
@@ -254,6 +268,8 @@ public class EventQueue
     * All pending events are transferred to the new queue. Calls to postEvent,
     * getNextEvent, and peekEvent are forwarded to the pushed queue until it
     * is removed with a pop().
+    *
+    * @exception NullPointerException if newEventQueue is null.
     */
   public synchronized void push(EventQueue newEventQueue)
   {
@@ -271,7 +287,11 @@ public class EventQueue
   }
 
   /** 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
   {
     if (prev == null)
@@ -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)
   {
     if (evt instanceof ActiveEvent)
index 2019572d5f6ae6ed6e2e582ab4e7467118ee3855..764424c82c339ea875612ba27732942251ee71e0 100644 (file)
@@ -142,16 +142,15 @@ FileDialog(Frame parent, String title)
   * @param title The title for this dialog.
   * @param mode The mode of the dialog, either <code>LOAD</code> or
   * <code>SAVE</code>.
+  *
+  * @exception IllegalArgumentException If an illegal file dialog mode
+  * is supplied.
   */
 public
 FileDialog(Frame parent, String title, int mode)
 {
   super(parent, title, true);
-
-  if ((mode != LOAD) && (mode != SAVE))
-    throw new IllegalArgumentException("Bad mode: " + mode);
-
-  this.mode = mode;
+  setMode (mode);
 }
 
 /*************************************************************************/
@@ -180,6 +179,9 @@ getMode()
   * peer is created.
   *
   * @param mode The new mode of this file dialog.
+  *
+  * @exception IllegalArgumentException If an illegal file dialog mode
+  * is supplied.
   */
 public void
 setMode(int mode)
index 879fae5ad5138e4e0355f92c290dcb03e998e643..ed80936bfcbf4534a224055ec566b5a7b7e0844a 100644 (file)
@@ -38,6 +38,7 @@ package java.awt;
 
 import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
+import java.awt.image.BufferedImageOp;
 import java.awt.image.RenderedImage;
 import java.awt.image.ImageObserver;
 import java.awt.image.renderable.RenderableImage;
@@ -74,7 +75,7 @@ public abstract class Graphics2D extends Graphics
                                    ImageObserver obs);
 
   public abstract void drawImage(BufferedImage image,
-                                BufferedImage op,
+                                BufferedImageOp op,
                                 int x,
                                 int y);
 
index 36ea45b944ae8142973dac79f59acecfbce4fffc..b029b2a3cd5a773c3bdb79aab100da5d53de658c 100644 (file)
@@ -99,6 +99,8 @@ private String text;
 
 /**
   * Initializes a new instance of <code>Label</code> with no text.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 Label()
@@ -113,6 +115,8 @@ Label()
   * text that is aligned to the left.
   *
   * @param text The text of the label.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 Label(String text)
@@ -130,12 +134,17 @@ Label(String text)
   * @param alignment The desired alignment for the text in this label,
   * which must be one of <code>LEFT</code>, <code>CENTER</code>, or
   * <code>RIGHT</code>.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 Label(String text, int alignment)
 {
   setAlignment (alignment);
   setText (text);
+
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
 }
 
 /*************************************************************************/
index 18d63be749077f989afc4fb3155cc7f522ca30ce..326101b76e56601cbd2c849ebac92a0d6ea50a5c 100644 (file)
@@ -95,6 +95,8 @@ static final MenuItem separator = new MenuItem("-");
 /**
   * Initializes a new instance of <code>Menu</code> with no label and that
   * is not a tearoff;
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 Menu()
@@ -108,6 +110,8 @@ Menu()
   * that has the specified label.
   *
   * @param label The menu label.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 Menu(String label)
@@ -124,6 +128,8 @@ Menu(String label)
   * @param label The label for this menu
   * @param isTearOff <code>true</code> if this menu is a tear off menu,
   * <code>false</code> otherwise.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 Menu(String label, boolean isTearOff)
@@ -134,6 +140,9 @@ Menu(String label, boolean isTearOff)
 
   if (label.equals("Help"))
     isHelpMenu = true;
+
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
 }
 
 /*************************************************************************/
index 2e1a9636155369d3ed998ba10448adb1ae533e26..b9ddef9aa1b0653be2be2f29523eb60a358e631e 100644 (file)
@@ -86,10 +86,14 @@ private Vector menus = new Vector();
 
 /**
   * Initializes a new instance of <code>MenuBar</code>.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 MenuBar()
 {
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
 }
 
 /*************************************************************************/
index b9c6ea020f1f8869c3e81581d84474fc4499042a..548aa77937a1383e83823d399559152df5389a71 100644 (file)
@@ -92,10 +92,14 @@ private static transient Toolkit toolkit = Toolkit.getDefaultToolkit();
 
 /**
   * Default constructor for subclasses.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 protected
 MenuComponent()
 {
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
 }
 
 /*************************************************************************/
index 9553b87f10adbd972de035b284ea7f9f5d65adbe..d0f1980472b8ed55949df1dd260591ba0111bbc8 100644 (file)
@@ -65,6 +65,9 @@ private static final long serialVersionUID = -4620452533522760060L;
 
 /**
   * Initializes a new instance of <code>PopupMenu</code>.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+  * returns true.
   */
 public
 PopupMenu()
@@ -78,11 +81,17 @@ PopupMenu()
   * label.
   *
   * @param label The label for this popup menu.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+  * returns true.
   */
 public
 PopupMenu(String label)
 {
   super(label);
+
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
 }
 
 /*************************************************************************/
index e558d0bc23fbdb588ee2631d9d3db103828eaf7c..0c9354b28870acd2ee5b884d519eecfc36404a7f 100644 (file)
@@ -113,6 +113,8 @@ private Point scrollPosition = new Point(0, 0);
 /**
   * Initializes a new instance of <code>ScrollPane</code> with a default
   * scrollbar policy of <code>SCROLLBARS_AS_NEEDED</code>.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 ScrollPane()
@@ -128,10 +130,15 @@ ScrollPane()
   *
   * @param scrollbarDisplayPolicy When to display scrollbars, which must
   * be one of the constants defined in this class.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
   */
 public
 ScrollPane(int scrollbarDisplayPolicy)
 {
+  if (GraphicsEnvironment.isHeadless ())
+    throw new HeadlessException ();
+
   this.scrollbarDisplayPolicy = scrollbarDisplayPolicy;
 
   if (scrollbarDisplayPolicy != SCROLLBARS_ALWAYS
index 1f1875955bf04b30f18782990dccd88e16563749..db4a3fcd2dcddca925f4cea81d2ad5510234f1f8 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
 
@@ -40,7 +40,6 @@ package java.awt;
 
 import java.awt.peer.ScrollbarPeer;
 import java.awt.peer.ComponentPeer;
-
 import java.awt.event.AdjustmentListener;
 import java.awt.event.AdjustmentEvent;
 
@@ -126,7 +125,9 @@ private AdjustmentListener adjustment_listeners;
 
 /**
   * 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
 Scrollbar()
@@ -145,6 +146,7 @@ Scrollbar()
   *
   * @param orientation The orientation of this scrollbar.
   *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   * @exception IllegalArgumentException If the orientation value is not valid.
   */
 public
@@ -168,12 +170,16 @@ Scrollbar(int orientation) throws IllegalArgumentException
   * @param minimum The minimum 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.
   */
 public 
 Scrollbar(int orientation, int value, int visibleAmount, int minimum, 
           int maximum) throws IllegalArgumentException
 {
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
+
   if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
     throw new IllegalArgumentException("Bad orientation value: "
                                       + orientation);
index 799656ec5547d0c35fd304eb811c9a97557ecd8d..f164add49a1eec490163aaed7bf66a8a4e19ae40 100644 (file)
@@ -109,6 +109,8 @@ private int scrollbarVisibility;
   * Initialize a new instance of <code>TextArea</code> that is empty
   * and is one row and one column.  Both horizontal and vertical
   * scrollbars will be used.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   */
 public
 TextArea()
@@ -124,6 +126,8 @@ TextArea()
   * scrollbars will be used.
   *
   * @param text The text to display in this text area.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   */
 public
 TextArea(String text)
@@ -140,6 +144,8 @@ TextArea(String text)
   *
   * @param rows The number of rows in this text area.
   * @param columns The number of columns in this text area.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   */
 public
 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 rows The number of rows in this text area.
   * @param columns The number of columns in this text area.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   */
 public
 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 columns The number of columns in this text area.
   * @param scrollbarVisibility Which scrollbars to display.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   */
 public
 TextArea(String text, int rows, int columns, int scrollbarVisibility)
 {
   super(text);
 
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
+
   if ((rows < 1) || (columns < 0))
     throw new IllegalArgumentException("Bad row or column value");
 
index 28d444ce95fd80c4bf5ee65b7daed23c5904ca85..0106d77e3ad75cb8bb0c1bd169b972c8df90fd4c 100644 (file)
@@ -84,9 +84,11 @@ private ActionListener action_listeners;
  * Constructors
  */
 
-/*
+/**
  * Initializes a new instance of <code>TextField</code> that is empty
  * and has one column.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
  */
 public
 TextField()
@@ -102,6 +104,8 @@ TextField()
   * length of the text string.
   *
   * @param text The text to display in the field.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   */
 public
 TextField(String text)
@@ -116,6 +120,8 @@ TextField(String text)
   * and has the specified number of columns.
   *
   * @param columns The number of columns in the text field.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   */
 public
 TextField(int columns)
@@ -131,12 +137,17 @@ TextField(int columns)
   *
   * @param text The text to display in the field.
   * @param columns The number of columns in the field.
+  *
+  * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
   */
 public
 TextField(String text, int columns)
 {
   super(text);
   this.columns = columns;
+
+  if (GraphicsEnvironment.isHeadless())
+    throw new HeadlessException ();
 }
 
 /*************************************************************************/
index 0d146e6c6ebd282f783ef8d3c6710346a8ed6adf..a0948ef27eba093da7c2e9bb3a5ed3105e5dc361 100644 (file)
@@ -44,7 +44,7 @@ package java.awt.color;
   * @author Eric Blake <ebb9@email.byu.edu>
   * @status updated to 1.4
   */
-public class CMMException extends Exception
+public class CMMException extends RuntimeException
 {
   /**
    * Compatible with JDK 1.2+.
index 4f68fabcb7b3ec744bd66d742b447fe35f7c6a3a..9be70cb38a9650d2be68d5f9b21837c25205302d 100644 (file)
@@ -46,7 +46,7 @@ import java.io.Serializable;
  * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
  * @since 1.2
  */
-public abstract class ColorSpace
+public abstract class ColorSpace implements Serializable
 {
   /**
    * Compatible with JDK 1.2+.
index 7adaac0647220bbf08f304af6001effbe23ab921..eb534ebffca0aa9e41b0a937568e2126adb54f70 100644 (file)
@@ -245,7 +245,7 @@ public class ICC_Profile implements Serializable
     write(new FileOutputStream(filename));
   }
 
-  public void write(OutputStream out)
+  public void write(OutputStream out) throws IOException
   {
     throw new Error("not implemented");
   }
index 130781faf9bb66233bf73cef9bc95b5090a7d22f..89f47a207e1ee0a883fabfa1d9f9562f130caf25 100644 (file)
@@ -45,7 +45,7 @@ package java.awt.color;
   * @author Eric Blake <ebb9@email.byu.edu>
   * @status updated to 1.4
   */
-public class ProfileDataException extends Exception
+public class ProfileDataException extends RuntimeException
 {
   /**
    * Compatible with JDK 1.2+.
index 6ef9e70b6aa00d8ca7a31f70ea2bda63060dfabe..93bba7c1a3da1b56e6b9fcb62d862942e75b99ef 100644 (file)
@@ -103,6 +103,8 @@ getName()
   * Returns the contents of the clipboard.
   *
   * @param requestor The object requesting the contents.
+  *
+  * @exception IllegalStateException If the clipboard is currently unavailable
   */
 public synchronized Transferable
 getContents(Object requestor)
@@ -120,6 +122,8 @@ getContents(Object requestor)
   *
   * @param contents The new clipboard contents.
   * @param owner The new clipboard owner
+  *
+  * @exception IllegalStateException If the clipboard is currently unavailable
   */
 public synchronized void
 setContents(Transferable contents, ClipboardOwner owner)
index 85f6ae5d455b0909c599c995dbc6c120636a4767..e1500a7926cc4646c943b03798c26791a4d772ed 100644 (file)
@@ -281,6 +281,7 @@ DataFlavor(Class representationClass, String humanPresentableName)
   *
   * @exception IllegalArgumentException If the representation class
   * specified cannot be loaded.
+  * @exception ClassNotFoundException If the class is not loaded.
   */
 public
 DataFlavor(String mimeType, String humanPresentableName, 
@@ -504,6 +505,8 @@ setHumanPresentableName(String humanPresentableName)
   *
   * @return <code>true</code> if the MIME type is equal to this object's
   * MIME type, <code>false</code> otherwise.
+  *
+  * @exception NullPointerException If mimeType is null.
   */
 public final boolean
 isMimeTypeEqual(String mimeType)
@@ -652,6 +655,10 @@ isFlavorJavaFileListType()
   * Returns 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
 clone()
@@ -813,6 +820,8 @@ normalizeMimeType(String type)
   * Serialize this class.
   *
   * @param stream The <code>ObjectOutput</code> stream to serialize to.
+  *
+  * @exception IOException If an error occurs.
   */
 public void
 writeExternal(ObjectOutput stream) throws IOException
@@ -826,6 +835,10 @@ writeExternal(ObjectOutput stream) throws IOException
   * De-serialize this class.
   *
   * @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
 readExternal(ObjectInput stream) throws IOException, ClassNotFoundException
@@ -950,6 +963,10 @@ selectBestTextFlavor(DataFlavor[] availableFlavors)
   *
   * @param transferable The <code>Transferable</code> for which a text
   *                     <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
   * support this <code>DataFlavor</code>. Or if the representable class
   * isn't a (subclass of) <code>Reader</code>, <code>String</code>,
index 96b160842d9bc22552376d8272199a02d873d353..a392615063159ae4af27097988837038239d59cd 100644 (file)
@@ -41,42 +41,35 @@ package java.awt.datatransfer;
 import java.util.Map;
 
 /**
 * This interface maps between native platform type names and DataFlavors.
 *
 * @author Aaron M. Renn (arenn@urbanophile.com)
 */
+ * This interface maps between native platform type names and DataFlavors.
+ *
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ */
 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
-  * 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 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
-
+  /**
+   * 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);
+}
index 50064db4c92a4803aee8c9867a97bf2cc8247eb3..7d914120e8f3112e7b9c2d5ee6320a57d53b3427 100644 (file)
@@ -40,6 +40,7 @@ package java.awt.datatransfer;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.List;
 
 /**
   * This class maps between native platform type names and DataFlavors.
@@ -47,134 +48,122 @@ import java.util.Map;
   * XXX - The current implementation does no mapping at all.
   *
   * @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.
-  */
-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.
+  * @since 1.2
   */
-public static String
-decodeJavaMIMEType(String name)
+public final class SystemFlavorMap implements FlavorMap, FlavorTable
 {
-  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);
-}
+  /**
+   * 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.
+   */
+  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
-
index 84fa1cbb90121a97ea704369e9d14e69cf3f548c..3d268820ba715c9584a5f2f1685ff6186bb6d254 100644 (file)
@@ -113,15 +113,42 @@ public class DragGestureEvent extends EventObject
   {
     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)
   {
     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,
                         DragSourceListener 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,
                         Transferable trans, DragSourceListener l)
   {
index 674e26e8a3b314dbc20f3f261c323cc6f9b075e5..cd204b6fe93c1619dc9902f201587022d266dffe 100644 (file)
@@ -130,6 +130,12 @@ public abstract class DragGestureRecognizer implements Serializable
     throw new Error("not implemented");
   }
 
+  /**
+   * Register a new DragGestureListener.
+   *
+   * @exception TooManyListenersException If a DragGestureListener has already
+   * been added.
+   */
   public void addDragGestureListener(DragGestureListener dgl)
     throws TooManyListenersException
   {
index 01cae00a3cf2180d356a17617ec4288064dd62bf..740235ac83c07233f7effa03ee6e67e3b31c5dee 100644 (file)
@@ -40,6 +40,8 @@ package java.awt.dnd;
 
 import java.awt.Component;
 import java.awt.Cursor;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
 import java.awt.Image;
 import java.awt.Point;
 import java.awt.datatransfer.FlavorMap;
@@ -62,10 +64,20 @@ public class DragSource implements Serializable
   public static final Cursor DefaultMoveNoDrop = null;
   public static final Cursor DefaultLinkNoDrop = null;
 
+  /**
+   * Initializes the drag source.
+   *
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+   */
   public DragSource()
   {
+    if (GraphicsEnvironment.isHeadless())
+      throw new HeadlessException ();
   }
 
+  /**
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+   */
   public static DragSource getDefaultDragSource()
   {
     return null;
@@ -76,6 +88,13 @@ public class DragSource implements Serializable
     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,
                         Image dragImage, Point imageOffset,
                         Transferable trans, DragSourceListener dsl,
@@ -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,
                         Transferable trans, DragSourceListener dsl,
                         FlavorMap map)
@@ -90,6 +116,13 @@ public class DragSource implements Serializable
     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,
                         Image dragImage, Point imageOffset,
                         Transferable trans, DragSourceListener dsl)
@@ -97,12 +130,25 @@ public class DragSource implements Serializable
     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,
                         Transferable trans, DragSourceListener dsl)
   {
     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
     createDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge,
                             Cursor cursor, Image image, Point offset,
index c469605b8b4469d7c545626bbbab6fdf41954087..53c09178d32e69e67c3890917d0ea70ce057fcf7 100644 (file)
@@ -42,10 +42,13 @@ import java.awt.Component;
 import java.awt.datatransfer.FlavorMap;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.io.Serializable;
+import java.util.EventListener;
 import java.util.TooManyListenersException;
 
 /** STUB CLASS ONLY */
 public class DropTarget
+  implements DropTargetListener, EventListener, Serializable
 {
   protected static class DropTargetAutoScroller
     implements ActionListener
@@ -67,6 +70,9 @@ public class DropTarget
     }
   }
   
+  // FIXME: check the correctness of default value.
+  private boolean isActive = false;
+    
   /**
    * FIXME
    *
@@ -133,11 +139,12 @@ public class DropTarget
 
   public void setActive(boolean isActive)
   {
+    this.isActive = isActive;
   }
 
   public boolean isActive()
   {
-    return false;
+    return this.isActive;
   }
 
   /**
index ca51ba545b4f035931892e8129777cebafe0f78b..6e40d5165b8c2e1411da942eab3bd2f8fa505c67 100644 (file)
@@ -109,7 +109,7 @@ public class WindowEvent extends ComponentEvent
   public static final int WINDOW_STATE_CHANGED = 209;
 
   /** 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
index 6cf77d74df21c259a0980b8b229a858fef3bea37..c23eb351306d4e039d2ecef501999b13ad65e272 100644 (file)
@@ -84,7 +84,7 @@ public interface PathIterator
    * (P1), and final interpolated control point (P2):
    * <pre>
    *  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
    *         = C(n,m) * t^(m) * (1 - t)^(n-m)
    *  C(n,m) = Combinations of n things, taken m at a time
@@ -100,7 +100,7 @@ public interface PathIterator
    * (P2), and final interpolated control point (P3):
    * <pre>
    *  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
    *         = C(n,m) * t^(m) * (1 - t)^(n-m)
    *  C(n,m) = Combinations of n things, taken m at a time
index 5398fc5de773571963522f8a186c94fe947c3337..2946d259b917b05159a951efd8352b9d67cad30d 100644 (file)
@@ -178,7 +178,7 @@ public class InputMethodHighlight
    * @return the style map
    * @since 1.3
    */
-  public Map getSytle()
+  public Map getStyle()
   {
     return style;
   }
index b819f309c2a335826d59a34a0ed74e5d9b0f0dd9..68b656b1925d59fb1765d6841ce5967e7bff7f8d 100644 (file)
@@ -97,7 +97,7 @@ public class PipedOutputStream extends OutputStream
     */
   public void connect(PipedInputStream sink) throws IOException
   {
-    if (sink != null)
+    if (this.sink != null || sink.source != null)
       throw new IOException ("Already connected");
     sink.connect(this);
   }
index a8844d746f27a7acfe208af92a659eaf20e552d8..0ab3c0b8e1218a4a893c414f1630faefb75b9db3 100644 (file)
@@ -100,7 +100,7 @@ public class PipedWriter extends Writer
     */
   public void connect(PipedReader sink) throws IOException
   {
-    if (sink != null)
+    if (this.sink != null || sink.source != null)
       throw new IOException ("Already connected");
     sink.connect(this);
   }
index 1b00970e44191938db7a681760dbd53bf99a5180..057ca0fd402dab748027a1c1b164928955516b3b 100644 (file)
@@ -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)
diff --git a/libjava/java/rmi/server/RMIClassLoaderSpi.java b/libjava/java/rmi/server/RMIClassLoaderSpi.java
new file mode 100644 (file)
index 0000000..2dbb384
--- /dev/null
@@ -0,0 +1,64 @@
+/* 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);
+}