diff options
43 files changed, 914 insertions, 422 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 8f58e13f938..1d3d4bd6030 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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: diff --git a/libjava/Makefile.am b/libjava/Makefile.am index cbacaf3f77f..e9f52f94cd7 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -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 \ diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 295fd893b4c..595c24fbfe7 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -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 \ diff --git a/libjava/gnu/awt/j2d/Graphics2DImpl.java b/libjava/gnu/awt/j2d/Graphics2DImpl.java index ef4d742c056..5af41bfc9cb 100644 --- a/libjava/gnu/awt/j2d/Graphics2DImpl.java +++ b/libjava/gnu/awt/j2d/Graphics2DImpl.java @@ -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"); } diff --git a/libjava/java/awt/AlphaComposite.java b/libjava/java/awt/AlphaComposite.java index 14649fc74a3..f0795a96010 100644 --- a/libjava/java/awt/AlphaComposite.java +++ b/libjava/java/awt/AlphaComposite.java @@ -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)) diff --git a/libjava/java/awt/BasicStroke.java b/libjava/java/awt/BasicStroke.java index c3290336cd9..3d0a2e74506 100644 --- a/libjava/java/awt/BasicStroke.java +++ b/libjava/java/awt/BasicStroke.java @@ -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); diff --git a/libjava/java/awt/BufferCapabilities.java b/libjava/java/awt/BufferCapabilities.java index 389594b76b5..871529e6e93 100644 --- a/libjava/java/awt/BufferCapabilities.java +++ b/libjava/java/awt/BufferCapabilities.java @@ -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) { diff --git a/libjava/java/awt/Button.java b/libjava/java/awt/Button.java index ed954ddcfda..989fbc95173 100644 --- a/libjava/java/awt/Button.java +++ b/libjava/java/awt/Button.java @@ -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) diff --git a/libjava/java/awt/CheckboxMenuItem.java b/libjava/java/awt/CheckboxMenuItem.java index 2f7ecd79fc5..88218397c3c 100644 --- a/libjava/java/awt/CheckboxMenuItem.java +++ b/libjava/java/awt/CheckboxMenuItem.java @@ -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 (); } /*************************************************************************/ diff --git a/libjava/java/awt/Choice.java b/libjava/java/awt/Choice.java index 81a2a31c932..4c7b505535c 100644 --- a/libjava/java/awt/Choice.java +++ b/libjava/java/awt/Choice.java @@ -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 (); diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java index dd2390d35ba..9494d8c56ac 100644 --- a/libjava/java/awt/Container.java +++ b/libjava/java/awt/Container.java @@ -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) { } - // 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); + } } } - // 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 - /** * 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) { } diff --git a/libjava/java/awt/Cursor.java b/libjava/java/awt/Cursor.java index 5852b8bbf85..8652a1e5ebe 100644 --- a/libjava/java/awt/Cursor.java +++ b/libjava/java/awt/Cursor.java @@ -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; } diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java index 1ce3d163181..6b64fb7ee3b 100644 --- a/libjava/java/awt/EventQueue.java +++ b/libjava/java/awt/EventQueue.java @@ -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) diff --git a/libjava/java/awt/FileDialog.java b/libjava/java/awt/FileDialog.java index 2019572d5f6..764424c82c3 100644 --- a/libjava/java/awt/FileDialog.java +++ b/libjava/java/awt/FileDialog.java @@ -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) diff --git a/libjava/java/awt/Graphics2D.java b/libjava/java/awt/Graphics2D.java index 879fae5ad51..ed80936bfcb 100644 --- a/libjava/java/awt/Graphics2D.java +++ b/libjava/java/awt/Graphics2D.java @@ -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); diff --git a/libjava/java/awt/Label.java b/libjava/java/awt/Label.java index 36ea45b944a..b029b2a3cd5 100644 --- a/libjava/java/awt/Label.java +++ b/libjava/java/awt/Label.java @@ -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 (); } /*************************************************************************/ diff --git a/libjava/java/awt/Menu.java b/libjava/java/awt/Menu.java index 18d63be7490..326101b76e5 100644 --- a/libjava/java/awt/Menu.java +++ b/libjava/java/awt/Menu.java @@ -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 (); } /*************************************************************************/ diff --git a/libjava/java/awt/MenuBar.java b/libjava/java/awt/MenuBar.java index 2e1a9636155..b9ddef9aa1b 100644 --- a/libjava/java/awt/MenuBar.java +++ b/libjava/java/awt/MenuBar.java @@ -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 (); } /*************************************************************************/ diff --git a/libjava/java/awt/MenuComponent.java b/libjava/java/awt/MenuComponent.java index b9c6ea020f1..548aa77937a 100644 --- a/libjava/java/awt/MenuComponent.java +++ b/libjava/java/awt/MenuComponent.java @@ -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 (); } /*************************************************************************/ diff --git a/libjava/java/awt/PopupMenu.java b/libjava/java/awt/PopupMenu.java index 9553b87f10a..d0f1980472b 100644 --- a/libjava/java/awt/PopupMenu.java +++ b/libjava/java/awt/PopupMenu.java @@ -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 (); } /*************************************************************************/ diff --git a/libjava/java/awt/ScrollPane.java b/libjava/java/awt/ScrollPane.java index e558d0bc23f..0c9354b2887 100644 --- a/libjava/java/awt/ScrollPane.java +++ b/libjava/java/awt/ScrollPane.java @@ -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 diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java index 1f1875955bf..db4a3fcd2dc 100644 --- a/libjava/java/awt/Scrollbar.java +++ b/libjava/java/awt/Scrollbar.java @@ -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); diff --git a/libjava/java/awt/TextArea.java b/libjava/java/awt/TextArea.java index 799656ec554..f164add49a1 100644 --- a/libjava/java/awt/TextArea.java +++ b/libjava/java/awt/TextArea.java @@ -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"); diff --git a/libjava/java/awt/TextField.java b/libjava/java/awt/TextField.java index 28d444ce95f..0106d77e3ad 100644 --- a/libjava/java/awt/TextField.java +++ b/libjava/java/awt/TextField.java @@ -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 (); } /*************************************************************************/ diff --git a/libjava/java/awt/color/CMMException.java b/libjava/java/awt/color/CMMException.java index 0d146e6c6eb..a0948ef27eb 100644 --- a/libjava/java/awt/color/CMMException.java +++ b/libjava/java/awt/color/CMMException.java @@ -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+. diff --git a/libjava/java/awt/color/ColorSpace.java b/libjava/java/awt/color/ColorSpace.java index 4f68fabcb7b..9be70cb38a9 100644 --- a/libjava/java/awt/color/ColorSpace.java +++ b/libjava/java/awt/color/ColorSpace.java @@ -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+. diff --git a/libjava/java/awt/color/ICC_Profile.java b/libjava/java/awt/color/ICC_Profile.java index 7adaac06472..eb534ebffca 100644 --- a/libjava/java/awt/color/ICC_Profile.java +++ b/libjava/java/awt/color/ICC_Profile.java @@ -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"); } diff --git a/libjava/java/awt/color/ProfileDataException.java b/libjava/java/awt/color/ProfileDataException.java index 130781faf9b..89f47a207e1 100644 --- a/libjava/java/awt/color/ProfileDataException.java +++ b/libjava/java/awt/color/ProfileDataException.java @@ -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+. diff --git a/libjava/java/awt/datatransfer/Clipboard.java b/libjava/java/awt/datatransfer/Clipboard.java index 6ef9e70b6aa..93bba7c1a3d 100644 --- a/libjava/java/awt/datatransfer/Clipboard.java +++ b/libjava/java/awt/datatransfer/Clipboard.java @@ -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) diff --git a/libjava/java/awt/datatransfer/DataFlavor.java b/libjava/java/awt/datatransfer/DataFlavor.java index 85f6ae5d455..e1500a7926c 100644 --- a/libjava/java/awt/datatransfer/DataFlavor.java +++ b/libjava/java/awt/datatransfer/DataFlavor.java @@ -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>, diff --git a/libjava/java/awt/datatransfer/FlavorMap.java b/libjava/java/awt/datatransfer/FlavorMap.java index 96b160842d9..a3926150631 100644 --- a/libjava/java/awt/datatransfer/FlavorMap.java +++ b/libjava/java/awt/datatransfer/FlavorMap.java @@ -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); +} diff --git a/libjava/java/awt/datatransfer/SystemFlavorMap.java b/libjava/java/awt/datatransfer/SystemFlavorMap.java index 50064db4c92..7d914120e8f 100644 --- a/libjava/java/awt/datatransfer/SystemFlavorMap.java +++ b/libjava/java/awt/datatransfer/SystemFlavorMap.java @@ -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 - diff --git a/libjava/java/awt/dnd/DragGestureEvent.java b/libjava/java/awt/dnd/DragGestureEvent.java index 84fa1cbb901..3d268820ba7 100644 --- a/libjava/java/awt/dnd/DragGestureEvent.java +++ b/libjava/java/awt/dnd/DragGestureEvent.java @@ -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) { diff --git a/libjava/java/awt/dnd/DragGestureRecognizer.java b/libjava/java/awt/dnd/DragGestureRecognizer.java index 674e26e8a3b..cd204b6fe93 100644 --- a/libjava/java/awt/dnd/DragGestureRecognizer.java +++ b/libjava/java/awt/dnd/DragGestureRecognizer.java @@ -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 { diff --git a/libjava/java/awt/dnd/DragSource.java b/libjava/java/awt/dnd/DragSource.java index 01cae00a3cf..740235ac83c 100644 --- a/libjava/java/awt/dnd/DragSource.java +++ b/libjava/java/awt/dnd/DragSource.java @@ -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, diff --git a/libjava/java/awt/dnd/DropTarget.java b/libjava/java/awt/dnd/DropTarget.java index c469605b8b4..53c09178d32 100644 --- a/libjava/java/awt/dnd/DropTarget.java +++ b/libjava/java/awt/dnd/DropTarget.java @@ -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; } /** diff --git a/libjava/java/awt/event/WindowEvent.java b/libjava/java/awt/event/WindowEvent.java index ca51ba545b4..6e40d5165b8 100644 --- a/libjava/java/awt/event/WindowEvent.java +++ b/libjava/java/awt/event/WindowEvent.java @@ -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 diff --git a/libjava/java/awt/geom/PathIterator.java b/libjava/java/awt/geom/PathIterator.java index 6cf77d74df2..c23eb351306 100644 --- a/libjava/java/awt/geom/PathIterator.java +++ b/libjava/java/awt/geom/PathIterator.java @@ -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 <= t <= 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 <= t <= 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 diff --git a/libjava/java/awt/im/InputMethodHighlight.java b/libjava/java/awt/im/InputMethodHighlight.java index 5398fc5de77..2946d259b91 100644 --- a/libjava/java/awt/im/InputMethodHighlight.java +++ b/libjava/java/awt/im/InputMethodHighlight.java @@ -178,7 +178,7 @@ public class InputMethodHighlight * @return the style map * @since 1.3 */ - public Map getSytle() + public Map getStyle() { return style; } diff --git a/libjava/java/io/PipedOutputStream.java b/libjava/java/io/PipedOutputStream.java index b819f309c2a..68b656b1925 100644 --- a/libjava/java/io/PipedOutputStream.java +++ b/libjava/java/io/PipedOutputStream.java @@ -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); } diff --git a/libjava/java/io/PipedWriter.java b/libjava/java/io/PipedWriter.java index a8844d746f2..0ab3c0b8e12 100644 --- a/libjava/java/io/PipedWriter.java +++ b/libjava/java/io/PipedWriter.java @@ -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); } diff --git a/libjava/java/rmi/server/RMIClassLoader.java b/libjava/java/rmi/server/RMIClassLoader.java index 1b00970e441..057ca0fd402 100644 --- a/libjava/java/rmi/server/RMIClassLoader.java +++ b/libjava/java/rmi/server/RMIClassLoader.java @@ -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 index 00000000000..2dbb3849c27 --- /dev/null +++ b/libjava/java/rmi/server/RMIClassLoaderSpi.java @@ -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); +} |