This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: java.awt


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch. This will soon be in classpath too.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+bJIJWSOgCCdjSDsRAjwgAJwLV/tcBhGu0daKYg/0r1ZP9X//sACgmds9
+xcn8NxLvqMq7BChMohy5S4=
=yEQv
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1767
diff -u -r1.1767 ChangeLog
--- ChangeLog	9 Mar 2003 22:50:01 -0000	1.1767
+++ ChangeLog	10 Mar 2003 13:20:26 -0000
@@ -1,3 +1,73 @@
+2003-03-10  Michael Koch  <konqueror at gmx dot de>
+
+	* java/awt/FocusTraversalPolicy.java
+	(FocusTraversalPolicy): Documentation added.
+	(getComponentAfter): Documentation added.
+	(getComponentBefore): Documentation added.
+	(getFirstComponent): Documentation added.
+	(getLastComponent): Documentation added.
+	(getDefaultComponent): Documentation added.
+	(getInitialComponent): Documentation added.
+	* java/awt/ScrollPaneAdjustable.java
+	(sp): New member variable.
+	(orientation): New member variable.
+	(value): New member variable.
+	(minimum): New member variable.
+	(maximum): New member variable.
+	(visibleAmount): New member variable.
+	(unitIncrement): New member variable.
+	(blockIncrement): New member variable.
+	(adjustmentListener): New member variable.
+	(ScrollPaneAdjustable): Rewrote.
+	(addAdjustmentListener): New method.
+	(removeAdjustmentListener): New method.
+	(getAdjustmentListeners): New method.
+	(getBlockIncrement): New method.
+	(getMaximum): New method.
+	(getMinimum): New method.
+	(getOrientation): New method.
+	(getUnitIncrement): New method.
+	(getValue): New method.
+	(getVisibleAmount): New method.
+	(setBlockIncrement): New method.
+	(setUnitIncrement): New method.
+	(setMaximum): Implemented.
+	(setMinimum): Implemented.
+	(setValue): New method.
+	(setVisibleAmount): Implemented.
+	(paramString): New method.
+	* java/awt/Window.java
+	(show): Use setVisible(true) instead of super.show().
+	(hide): Use sevVisible(false) instead of super.hide().
+	(processWindowEvent): Added cases for WINDOW_GAINED_FOCUS,
+	WINDOW_LOST_FOCUS and WINDOW_STATE_CHANGED.
+	(postEvent): Deprecated.
+	(applyResourceBundle): Deprecated.
+	(processWindowFocusEvent): New method.
+	(processWindowStateEvent): New method.
+	* java/awt/datatransfer/DataFlavor.java: Reindented.
+	* java/awt/font/TextHitInfo.java
+	(charIndex): New member variable.
+	(leadingEdge): New member variable.
+	(TextHitInfo): New constructor.
+	(getCharIndex): Implemented.
+	(isLeadingEdge): Implemented.
+	(getInsertionIndex): Implemented.
+	(hashCode): Access charIndex directly.
+	(equals): Reformated.
+	(leading): Implemented.
+	(trailing): Implemented.
+	(beforeOffset): Implemented.
+	(afterOffset): Implemented.
+	(getOtherHit): Implemented.
+	(getOffsetHit): Implemented.
+	(toString): Implemented.
+	* java/awt/image/BufferedImage.java
+	(BufferedImage): Implements WritableRenderedImage.
+	(observers): New member variable.
+	(addTileObserver): New method.
+	(removeTileObserver): New method.
+
 2003-03-09  Tom Tromey  <tromey at redhat dot com>
 
 	PR libgcj/9934:
Index: java/awt/FocusTraversalPolicy.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/FocusTraversalPolicy.java,v
retrieving revision 1.1
diff -u -r1.1 FocusTraversalPolicy.java
--- java/awt/FocusTraversalPolicy.java	9 Aug 2002 04:26:14 -0000	1.1
+++ java/awt/FocusTraversalPolicy.java	10 Mar 2003 13:20:26 -0000
@@ -39,26 +39,63 @@
 package java.awt;
 
 /**
- * STUB CLASS ONLY
+ * @since 1.4
  */
 public abstract class FocusTraversalPolicy
 {
+  /**
+   * Creates a <code>FocusTraversalPolicy</code> object.
+   */
   public FocusTraversalPolicy()
   {
+    // Do nothing in here.
   }
 
+  /**
+   * Returns the Component that should receive the focus after a Component.
+   *
+   * @exception IllegalArgumentException If root or current is null,
+   * or if root is not a focus cycle root of current.
+   */
   public abstract Component getComponentAfter(Container root,
                                               Component current);
 
+  /**
+   * Returns the Component that should receive the focus before a Component.
+   *
+   * @exception IllegalArgumentException If root or current is null,
+   * or if root is not a focus cycle root of current.
+   */
   public abstract Component getComponentBefore(Container root,
                                                Component current);
 
+  /**
+   * Returns the first Component in the traversal cycle.
+   *
+   * @exception IllegalArgumentException If root is null.
+   */
   public abstract Component getFirstComponent(Container root);
 
+  /**
+   * Returns the last Component in the traversal cycle.
+   *
+   * @exception IllegalArgumentException If root is null.
+   */
   public abstract Component getLastComponent(Container root);
 
+  /**
+   * Returns the default Component to focus.
+   *
+   * @exception IllegalArgumentException If root is null.
+   */
   public abstract Component getDefaultComponent(Container root);
 
+  /**
+   * Returns the Component that should receive the focus when a Window is made
+   * visible for the first time.
+   *
+   * @exception IllegalArgumentException If window is null.
+   */
   public Component getInitialComponent(Window window)
   {
     return getDefaultComponent(window);
Index: java/awt/Window.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Window.java,v
retrieving revision 1.17
diff -u -r1.17 Window.java
--- java/awt/Window.java	15 Feb 2003 09:21:55 -0000	1.17
+++ java/awt/Window.java	10 Mar 2003 13:20:26 -0000
@@ -503,30 +503,30 @@
   {
     if (windowListener != null)
       {
-	switch (evt.getID())
-	  {
-	  case WindowEvent.WINDOW_ACTIVATED:
-	    windowListener.windowActivated(evt);
-	    break;
-	  case WindowEvent.WINDOW_CLOSED:
-	    windowListener.windowClosed(evt);
-	    break;
-	  case WindowEvent.WINDOW_CLOSING:
-	    windowListener.windowClosing(evt);
-	    break;
-	  case WindowEvent.WINDOW_DEACTIVATED:
-	    windowListener.windowDeactivated(evt);
-	    break;
-	  case WindowEvent.WINDOW_DEICONIFIED:
-	    windowListener.windowDeiconified(evt);
-	    break;
-	  case WindowEvent.WINDOW_ICONIFIED:
-	    windowListener.windowIconified(evt);
-	    break;
-	  case WindowEvent.WINDOW_OPENED:
-	    windowListener.windowOpened(evt);
-	    break;
-	  }
+        switch (evt.getID())
+          {
+          case WindowEvent.WINDOW_ACTIVATED:
+            windowListener.windowActivated(evt);
+            break;
+          case WindowEvent.WINDOW_CLOSED:
+            windowListener.windowClosed(evt);
+            break;
+          case WindowEvent.WINDOW_CLOSING:
+            windowListener.windowClosing(evt);
+            break;
+          case WindowEvent.WINDOW_DEACTIVATED:
+            windowListener.windowDeactivated(evt);
+            break;
+          case WindowEvent.WINDOW_DEICONIFIED:
+            windowListener.windowDeiconified(evt);
+            break;
+          case WindowEvent.WINDOW_ICONIFIED:
+            windowListener.windowIconified(evt);
+            break;
+          case WindowEvent.WINDOW_OPENED:
+            windowListener.windowOpened(evt);
+            break;
+          }
       }
   }
 
Index: java/awt/datatransfer/DataFlavor.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/datatransfer/DataFlavor.java,v
retrieving revision 1.7
diff -u -r1.7 DataFlavor.java
--- java/awt/datatransfer/DataFlavor.java	15 Feb 2003 13:26:26 -0000	1.7
+++ java/awt/datatransfer/DataFlavor.java	10 Mar 2003 13:20:26 -0000
@@ -51,11 +51,11 @@
 import java.nio.CharBuffer;
 
 /**
-  * This class represents a particular data format used for transferring
-  * data via the clipboard.
-  *
-  * @author Aaron M. Renn (arenn at urbanophile dot com)
-  */
+ * This class represents a particular data format used for transferring
+ * data via the clipboard.
+ *
+ * @author Aaron M. Renn (arenn at urbanophile dot com)
+ */
 public class DataFlavor implements java.io.Externalizable, Cloneable
 {
   static final long serialVersionUID = 8367026044764648243L;
@@ -67,50 +67,50 @@
  */
 
 /**
-  * This is the data flavor used for tranferring plain text.  The MIME
-  * type is "text/plain; charset=unicode".  The representation class
-  * is <code>java.io.InputStream</code>.
-  *
-  * @deprecated The charset unicode is platform specific and InputStream
-  * deals with bytes not chars. Use <code>getRederForText()</code>.
-  */
+ * This is the data flavor used for tranferring plain text.  The MIME
+ * type is "text/plain; charset=unicode".  The representation class
+ * is <code>java.io.InputStream</code>.
+ *
+ * @deprecated The charset unicode is platform specific and InputStream
+ * deals with bytes not chars. Use <code>getRederForText()</code>.
+ */
 public static final DataFlavor plainTextFlavor;
 
 /**
-  * This is the data flavor used for transferring Java strings.  The
-  * MIME type is "application/x-java-serialized-object" and the 
-  * representation class is <code>java.lang.String</code>.
-  */
+ * This is the data flavor used for transferring Java strings.  The
+ * MIME type is "application/x-java-serialized-object" and the 
+ * representation class is <code>java.lang.String</code>.
+ */
 public static final DataFlavor stringFlavor;
 
 /**
-  * This is a data flavor used for transferring lists of files.  The
-  * representation type is a <code>java.util.List</code>, with each element of 
-  * the list being a <code>java.io.File</code>.
-  */
+ * This is a data flavor used for transferring lists of files.  The
+ * representation type is a <code>java.util.List</code>, with each element of 
+ * the list being a <code>java.io.File</code>.
+ */
 public static final DataFlavor javaFileListFlavor;
 
 public static final DataFlavor imageFlavor;
 
 /**
-  * This is the MIME type used for transferring a serialized object.
-  * The representation class is the type of object be deserialized.
-  */
+ * This is the MIME type used for transferring a serialized object.
+ * The representation class is the type of object be deserialized.
+ */
 public static final String javaSerializedObjectMimeType =
   "application/x-java-serialized-object";
 
 /**
-  * This is the MIME type used to transfer a Java object reference within
-  * the same JVM.  The representation class is the class of the object
-  * being transferred.
-  */
+ * This is the MIME type used to transfer a Java object reference within
+ * the same JVM.  The representation class is the class of the object
+ * being transferred.
+ */
 public static final String javaJVMLocalObjectMimeType =
   "application/x-java-jvm-local-object";
 
 /**
-  * This is the MIME type used to transfer a link to a remote object.
-  * The representation class is the type of object being linked to.
-  */
+ * This is the MIME type used to transfer a link to a remote object.
+ * The representation class is the type of object being linked to.
+ */
 public static final String javaRemoteObjectMimeType =
   "application/x-java-remote-object";
 
@@ -158,17 +158,17 @@
  */
 
 /**
-  * This method attempts to load the named class.  The following class
-  * loaders are searched in order: the bootstrap class loader, the
-  * system class loader, the context class loader (if it exists), and
-  * the specified fallback class loader.
-  *
-  * @param className The name of the class to load.
-  * @param classLoader The class loader to use if all others fail, which
-  * may be <code>null</code>.
-  *
-  * @exception ClassNotFoundException If the class cannot be loaded.
-  */
+ * This method attempts to load the named class.  The following class
+ * loaders are searched in order: the bootstrap class loader, the
+ * system class loader, the context class loader (if it exists), and
+ * the specified fallback class loader.
+ *
+ * @param className The name of the class to load.
+ * @param classLoader The class loader to use if all others fail, which
+ * may be <code>null</code>.
+ *
+ * @exception ClassNotFoundException If the class cannot be loaded.
+ */
 protected static final Class
 tryToLoadClass(String className, ClassLoader classLoader)
                throws ClassNotFoundException
@@ -214,9 +214,9 @@
  */
 
 /**
-  * Empty public constructor needed for externalization.
-  * Should not be used for normal instantiation.
-  */
+ * Empty public constructor needed for externalization.
+ * Should not be used for normal instantiation.
+ */
 public
 DataFlavor()
 {
@@ -228,8 +228,8 @@
 /*************************************************************************/
 
 /**
-  * Private constructor.
-  */
+ * Private constructor.
+ */
 private
 DataFlavor(Class representationClass,
 	   String mimeType,
@@ -246,15 +246,15 @@
 /*************************************************************************/
 
 /**
-  * Initializes a new instance of <code>DataFlavor</code>.  The class
-  * and human readable name are specified, the MIME type will be
-  * "application/x-java-serialized-object". If the human readable name
-  * is not specified (<code>null</code>) then the human readable name
-  * will be the same as the MIME type.
-  *
-  * @param representationClass The representation class for this object.
-  * @param humanPresentableName The display name of the object.
-  */
+ * Initializes a new instance of <code>DataFlavor</code>.  The class
+ * and human readable name are specified, the MIME type will be
+ * "application/x-java-serialized-object". If the human readable name
+ * is not specified (<code>null</code>) then the human readable name
+ * will be the same as the MIME type.
+ *
+ * @param representationClass The representation class for this object.
+ * @param humanPresentableName The display name of the object.
+ */
 public
 DataFlavor(Class representationClass, String humanPresentableName)
 {
@@ -268,23 +268,23 @@
 /*************************************************************************/
 
 /**
-  * Initializes a new instance of <code>DataFlavor</code> with the
-  * specified MIME type and description.  If the MIME type has a
-  * "class=<rep class>" parameter then the representation class will
-  * be the class name specified. Otherwise the class defaults to
-  * <code>java.io.InputStream</code>. If the human readable name
-  * is not specified (<code>null</code>) then the human readable name
-  * will be the same as the MIME type.
-  *
-  * @param mimeType The MIME type for this flavor.
-  * @param humanPresentableName The display name of this flavor.
-  * @param classLoader The class loader for finding classes if the default
-  * class loaders do not work.
-  *
-  * @exception IllegalArgumentException If the representation class
-  * specified cannot be loaded.
-  * @exception ClassNotFoundException If the class is not loaded.
-  */
+ * Initializes a new instance of <code>DataFlavor</code> with the
+ * specified MIME type and description.  If the MIME type has a
+ * "class=<rep class>" parameter then the representation class will
+ * be the class name specified. Otherwise the class defaults to
+ * <code>java.io.InputStream</code>. If the human readable name
+ * is not specified (<code>null</code>) then the human readable name
+ * will be the same as the MIME type.
+ *
+ * @param mimeType The MIME type for this flavor.
+ * @param humanPresentableName The display name of this flavor.
+ * @param classLoader The class loader for finding classes if the default
+ * class loaders do not work.
+ *
+ * @exception IllegalArgumentException If the representation class
+ * specified cannot be loaded.
+ * @exception ClassNotFoundException If the class is not loaded.
+ */
 public
 DataFlavor(String mimeType, String humanPresentableName, 
            ClassLoader classLoader) throws ClassNotFoundException
@@ -317,22 +317,22 @@
 /*************************************************************************/
 
 /**
-  * Initializes a new instance of <code>DataFlavor</code> with the
-  * specified MIME type and description.  If the MIME type has a
-  * "class=<rep class>" parameter then the representation class will
-  * be the class name specified. Otherwise the class defaults to
-  * <code>java.io.InputStream</code>. If the human readable name
-  * is not specified (<code>null</code>) then the human readable name
-  * will be the same as the MIME type. This is the same as calling
-  * <code>new DataFlavor(mimeType, humanPresentableName, null)</code>.
-  *
-  * @param mimeType The MIME type for this flavor.
-  * @param humanPresentableName The display name of this flavor.
-  * @param classLoader The class loader for finding classes.
-  *
-  * @exception IllegalArgumentException If the representation class
-  * specified cannot be loaded.
-  */
+ * Initializes a new instance of <code>DataFlavor</code> with the
+ * specified MIME type and description.  If the MIME type has a
+ * "class=<rep class>" parameter then the representation class will
+ * be the class name specified. Otherwise the class defaults to
+ * <code>java.io.InputStream</code>. If the human readable name
+ * is not specified (<code>null</code>) then the human readable name
+ * will be the same as the MIME type. This is the same as calling
+ * <code>new DataFlavor(mimeType, humanPresentableName, null)</code>.
+ *
+ * @param mimeType The MIME type for this flavor.
+ * @param humanPresentableName The display name of this flavor.
+ * @param classLoader The class loader for finding classes.
+ *
+ * @exception IllegalArgumentException If the representation class
+ * specified cannot be loaded.
+ */
 public
 DataFlavor(String mimeType, String humanPresentableName)
            throws ClassNotFoundException
@@ -343,19 +343,19 @@
 /*************************************************************************/
 
 /**
-  * Initializes a new instance of <code>DataFlavor</code> with the specified
-  * MIME type.  This type can have a "class=" parameter to specify the
-  * representation class, and then the class must exist or an exception will
-  * be thrown. If there is no "class=" parameter then the representation class
-  * will be <code>java.io.InputStream</code>. This is the same as calling
-  * <code>new DataFlavor(mimeType, null)</code>.
-  *
-  * @param mimeType The MIME type for this flavor.
-  *
-  * @exception IllegalArgumentException If a class is not specified in
-  * the MIME type.
-  * @exception ClassNotFoundException If the class cannot be loaded.
-  */
+ * Initializes a new instance of <code>DataFlavor</code> with the specified
+ * MIME type.  This type can have a "class=" parameter to specify the
+ * representation class, and then the class must exist or an exception will
+ * be thrown. If there is no "class=" parameter then the representation class
+ * will be <code>java.io.InputStream</code>. This is the same as calling
+ * <code>new DataFlavor(mimeType, null)</code>.
+ *
+ * @param mimeType The MIME type for this flavor.
+ *
+ * @exception IllegalArgumentException If a class is not specified in
+ * the MIME type.
+ * @exception ClassNotFoundException If the class cannot be loaded.
+ */
 public
 DataFlavor(String mimeType) throws ClassNotFoundException
 {
@@ -365,10 +365,10 @@
 /*************************************************************************/
 
 /**
-  * Returns the MIME type of this flavor.
-  *
-  * @return The MIME type for this flavor.
-  */
+ * Returns the MIME type of this flavor.
+ *
+ * @return The MIME type for this flavor.
+ */
 public String
 getMimeType()
 {
@@ -378,10 +378,10 @@
 /*************************************************************************/
 
 /**
-  * Returns the representation class for this flavor.
-  *
-  * @return The representation class for this flavor.
-  */
+ * Returns the representation class for this flavor.
+ *
+ * @return The representation class for this flavor.
+ */
 public Class
 getRepresentationClass()
 {
@@ -391,10 +391,10 @@
 /*************************************************************************/
 
 /**
-  * Returns the human presentable name for this flavor.
-  *
-  * @return The human presentable name for this flavor.
-  */
+ * Returns the human presentable name for this flavor.
+ *
+ * @return The human presentable name for this flavor.
+ */
 public String
 getHumanPresentableName()
 {
@@ -404,10 +404,10 @@
 /*************************************************************************/
 
 /**
-  * Returns the primary MIME type for this flavor.
-  *
-  * @return The primary MIME type for this flavor.
-  */
+ * Returns the primary MIME type for this flavor.
+ *
+ * @return The primary MIME type for this flavor.
+ */
 public String
 getPrimaryType()
 {
@@ -421,10 +421,10 @@
 /*************************************************************************/
 
 /**
-  * Returns the MIME subtype for this flavor.
-  *
-  * @return The MIME subtype for this flavor.
-  */
+ * Returns the MIME subtype for this flavor.
+ *
+ * @return The MIME subtype for this flavor.
+ */
 public String
 getSubType()
 {
@@ -444,15 +444,15 @@
 /*************************************************************************/
 
 /**
-  * Returns the value of the named MIME type parameter, or <code>null</code>
-  * if the parameter does not exist. Given the parameter name and the mime
-  * string.
-  *
-  * @param paramName The name of the parameter.
-  * @param mimeString The mime string from where the name should be found.
-  *
-  * @return The value of the parameter or null.
-  */
+ * Returns the value of the named MIME type parameter, or <code>null</code>
+ * if the parameter does not exist. Given the parameter name and the mime
+ * string.
+ *
+ * @param paramName The name of the parameter.
+ * @param mimeString The mime string from where the name should be found.
+ *
+ * @return The value of the parameter or null.
+ */
 private static String
 getParameter(String paramName, String mimeString)
 {
@@ -470,14 +470,15 @@
 }
 
 /*************************************************************************/
+
 /**
-  * Returns the value of the named MIME type parameter, or <code>null</code>
-  * if the parameter does not exist.
-  *
-  * @param paramName The name of the paramter.
-  *
-  * @return The value of the parameter.
-  */
+ * Returns the value of the named MIME type parameter, or <code>null</code>
+ * if the parameter does not exist.
+ *
+ * @param paramName The name of the paramter.
+ *
+ * @return The value of the parameter.
+ */
 public String
 getParameter(String paramName)
 {
@@ -487,10 +488,10 @@
 /*************************************************************************/
 
 /**
-  * Sets the human presentable name to the specified value.
-  *
-  * @param humanPresentableName The new display name.
-  */
+ * Sets the human presentable name to the specified value.
+ *
+ * @param humanPresentableName The new display name.
+ */
 public void
 setHumanPresentableName(String humanPresentableName)
 {
@@ -500,16 +501,16 @@
 /*************************************************************************/
 
 /**
-  * Tests the MIME type of this object for equality against the specified
-  * MIME type.
-  *
-  * @param mimeType The MIME type to test against.
-  *
-  * @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.
-  */
+ * Tests the MIME type of this object for equality against the specified
+ * MIME type.
+ *
+ * @param mimeType The MIME type to test against.
+ *
+ * @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 boolean
 isMimeTypeEqual(String mimeType)
 {
@@ -521,14 +522,14 @@
 /*************************************************************************/
 
 /**
-  * Tests the MIME type of this object for equality against the specified
-  * data flavor's MIME type
-  *
-  * @param flavor The flavor to test against.
-  *
-  * @return <code>true</code> if the flavor's MIME type is equal to this 
-  * object's MIME type, <code>false</code> otherwise.
-  */
+ * Tests the MIME type of this object for equality against the specified
+ * data flavor's MIME type
+ *
+ * @param flavor The flavor to test against.
+ *
+ * @return <code>true</code> if the flavor's MIME type is equal to this 
+ * object's MIME type, <code>false</code> otherwise.
+ */
 public boolean
 isMimeTypeEqual(DataFlavor flavor)
 {
@@ -538,11 +539,11 @@
 /*************************************************************************/
 
 /**
-  * Tests whether or not this flavor represents a serialized object.
-  *
-  * @return <code>true</code> if this flavor represents a serialized
-  * object, <code>false</code> otherwise.
-  */
+ * Tests whether or not this flavor represents a serialized object.
+ *
+ * @return <code>true</code> if this flavor represents a serialized
+ * object, <code>false</code> otherwise.
+ */
 public boolean
 isMimeTypeSerializedObject()
 {
@@ -552,12 +553,12 @@
 /*************************************************************************/
 
 /**
-  * Tests whether or not this flavor has a representation class of
-  * <code>java.io.InputStream</code>.
-  *
-  * @param <code>true</code> if the representation class of this flavor
-  * is <code>java.io.InputStream</code>, <code>false</code> otherwise.
-  */
+ * Tests whether or not this flavor has a representation class of
+ * <code>java.io.InputStream</code>.
+ *
+ * @param <code>true</code> if the representation class of this flavor
+ * is <code>java.io.InputStream</code>, <code>false</code> otherwise.
+ */
 public boolean
 isRepresentationClassInputStream()
 {
@@ -567,12 +568,12 @@
 /*************************************************************************/
 
 /**
-  * Tests whether the representation class for this flavor is
-  * serializable.
-  *
-  * @param <code>true</code> if the representation class is serializable,
-  * <code>false</code> otherwise.
-  */
+ * Tests whether the representation class for this flavor is
+ * serializable.
+ *
+ * @param <code>true</code> if the representation class is serializable,
+ * <code>false</code> otherwise.
+ */
 public boolean
 isRepresentationClassSerializable()
 {
@@ -592,11 +593,11 @@
 /*************************************************************************/
 
 /**
-  * Tests whether the representation class for his flavor is remote.
-  *
-  * @return <code>true</code> if the representation class is remote,
-  * <code>false</code> otherwise.
-  */
+ * Tests whether the representation class for his flavor is remote.
+ *
+ * @return <code>true</code> if the representation class is remote,
+ * <code>false</code> otherwise.
+ */
 public boolean
 isRepresentationClassRemote()
 {
@@ -607,11 +608,11 @@
 /*************************************************************************/
 
 /**
-  * Tests whether or not this flavor represents a serialized object.
-  *
-  * @return <code>true</code> if this flavor represents a serialized
-  * object, <code>false</code> otherwise.
-  */
+ * Tests whether or not this flavor represents a serialized object.
+ *
+ * @return <code>true</code> if this flavor represents a serialized
+ * object, <code>false</code> otherwise.
+ */
 public boolean
 isFlavorSerializedObjectType()
 {
@@ -622,11 +623,11 @@
 /*************************************************************************/
 
 /**
-  * Tests whether or not this flavor represents a remote object.
-  *
-  * @return <code>true</code> if this flavor represents a remote object,
-  * <code>false</code> otherwise.
-  */
+ * Tests whether or not this flavor represents a remote object.
+ *
+ * @return <code>true</code> if this flavor represents a remote object,
+ * <code>false</code> otherwise.
+ */
 public boolean
 isFlavorRemoteObjectType()
 {
@@ -636,11 +637,11 @@
 /*************************************************************************/
 
 /**
-  * Tests whether or not this flavor represents a list of files.
-  *
-  * @return <code>true</code> if this flavor represents a list of files,
-  * <code>false</code> otherwise.
-  */
+ * Tests whether or not this flavor represents a list of files.
+ *
+ * @return <code>true</code> if this flavor represents a list of files,
+ * <code>false</code> otherwise.
+ */
 public boolean
 isFlavorJavaFileListType()
 {
@@ -654,14 +655,14 @@
 /*************************************************************************/
 
 /**
-  * 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.
-  */
+ * 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 () throws CloneNotSupportedException
 {
   try
@@ -677,15 +678,15 @@
 /*************************************************************************/
 
 /**
-  * This method test the specified <code>DataFlavor</code> for equality
-  * against this object.  This will be true if the MIME type and
-  * representation type are the equal.
-  *
-  * @param flavor The <code>DataFlavor</code> to test against.
-  *
-  * @return <code>true</code> if the flavor is equal to this object,
-  * <code>false</code> otherwise.
-  */
+ * This method test the specified <code>DataFlavor</code> for equality
+ * against this object.  This will be true if the MIME type and
+ * representation type are the equal.
+ *
+ * @param flavor The <code>DataFlavor</code> to test against.
+ *
+ * @return <code>true</code> if the flavor is equal to this object,
+ * <code>false</code> otherwise.
+ */
 public boolean
 equals(DataFlavor flavor)
 {
@@ -704,22 +705,22 @@
 /*************************************************************************/
 
 /**
-  * This method test the specified <code>Object</code> for equality
-  * against this object.  This will be true if the following conditions
-  * are met:
-  * <p>
-  * <ul>
-  * <li>The object is not <code>null</code>.
-  * <li>The object is an instance of <code>DataFlavor</code>.
-  * <li>The object's MIME type and representation class are equal to
-  * this object's.
-  * </ul>
-  *
-  * @param obj The <code>Object</code> to test against.
-  *
-  * @return <code>true</code> if the flavor is equal to this object,
-  * <code>false</code> otherwise.
-  */
+ * This method test the specified <code>Object</code> for equality
+ * against this object.  This will be true if the following conditions
+ * are met:
+ * <p>
+ * <ul>
+ * <li>The object is not <code>null</code>.
+ * <li>The object is an instance of <code>DataFlavor</code>.
+ * <li>The object's MIME type and representation class are equal to
+ * this object's.
+ * </ul>
+ *
+ * @param obj The <code>Object</code> to test against.
+ *
+ * @return <code>true</code> if the flavor is equal to this object,
+ * <code>false</code> otherwise.
+ */
 public boolean
 equals(Object obj)
 {
@@ -735,17 +736,17 @@
 /*************************************************************************/
 
 /**
-  * Tests whether or not the specified string is equal to the MIME type
-  * of this object.
-  *
-  * @param str The string to test against.
-  *
-  * @return <code>true</code> if the string is equal to this object's MIME
-  * type, <code>false</code> otherwise.
-  *
-  * @deprecated Not compatible with <code>hashCode()</code>.
-  *             Use <code>isMimeTypeEqual()</code>
-  */
+ * Tests whether or not the specified string is equal to the MIME type
+ * of this object.
+ *
+ * @param str The string to test against.
+ *
+ * @return <code>true</code> if the string is equal to this object's MIME
+ * type, <code>false</code> otherwise.
+ *
+ * @deprecated Not compatible with <code>hashCode()</code>.
+ *             Use <code>isMimeTypeEqual()</code>
+ */
 public boolean
 equals(String str)
 {
@@ -755,10 +756,10 @@
 /*************************************************************************/
 
 /**
-  * Returns the hash code for this data flavor.
-  * The hash code is based on the (lower case) mime type and the
-  * representation class.
-  */
+ * Returns the hash code for this data flavor.
+ * The hash code is based on the (lower case) mime type and the
+ * representation class.
+ */
 public int
 hashCode()
 {
@@ -768,9 +769,9 @@
 /*************************************************************************/
 
 /**
-  * Returns <code>true</code> when the given <code>DataFlavor</code>
-  * matches this one.
-  */
+ * Returns <code>true</code> when the given <code>DataFlavor</code>
+ * matches this one.
+ */
 public boolean
 match(DataFlavor dataFlavor)
 {
@@ -781,16 +782,16 @@
 /*************************************************************************/
 
 /**
-  * This method exists for backward compatibility.  It simply returns
-  * the same name/value pair passed in.
-  *
-  * @param name The parameter name.
-  * @param value The parameter value.
-  *
-  * @return The name/value pair.
-  *
-  * @deprecated
-  */
+ * This method exists for backward compatibility.  It simply returns
+ * the same name/value pair passed in.
+ *
+ * @param name The parameter name.
+ * @param value The parameter value.
+ *
+ * @return The name/value pair.
+ *
+ * @deprecated
+ */
 protected String
 normalizeMimeTypeParameter(String name, String value)
 {
@@ -800,15 +801,15 @@
 /*************************************************************************/
 
 /**
-  * This method exists for backward compatibility.  It simply returns
-  * the MIME type string unchanged.
-  *
-  * @param type The MIME type.
-  * 
-  * @return The MIME type.
-  *
-  * @deprecated
-  */
+ * This method exists for backward compatibility.  It simply returns
+ * the MIME type string unchanged.
+ *
+ * @param type The MIME type.
+ * 
+ * @return The MIME type.
+ *
+ * @deprecated
+ */
 protected String
 normalizeMimeType(String type)
 {
@@ -818,12 +819,12 @@
 /*************************************************************************/
 
 /**
-  * Serialize this class.
-  *
-  * @param stream The <code>ObjectOutput</code> stream to serialize to.
-  *
-  * @exception IOException If an error occurs.
-  */
+ * 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
 {
@@ -833,14 +834,14 @@
 /*************************************************************************/
 
 /**
-  * 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.
-  */
+ * 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
 {
@@ -850,9 +851,9 @@
 /*************************************************************************/
 
 /**
-  * Returns a string representation of this DataFlavor. Including the
-  * representation class name, MIME type and human presentable name.
-  */
+ * Returns a string representation of this DataFlavor. Including the
+ * representation class name, MIME type and human presentable name.
+ */
 public String
 toString()
 {
@@ -867,8 +868,8 @@
 /*************************************************************************/
 
 /**
-  * XXX - Currently returns <code>plainTextFlavor</code>.
-  */
+ * XXX - Currently returns <code>plainTextFlavor</code>.
+ */
 public static final DataFlavor
 getTextPlainUnicodeFlavor()
 {
@@ -878,10 +879,10 @@
 /*************************************************************************/
 
 /**
-  * XXX - Currently returns <code>java.io.InputStream</code>.
-  *
-  * @since 1.3
-  */
+ * XXX - Currently returns <code>java.io.InputStream</code>.
+ *
+ * @since 1.3
+ */
 public final Class
 getDefaultRepresentationClass()
 {
@@ -890,8 +891,8 @@
 /*************************************************************************/
 
 /**
-  * XXX - Currently returns <code>java.io.InputStream</code>.
-  */
+ * XXX - Currently returns <code>java.io.InputStream</code>.
+ */
 public final String
 getDefaultRepresentationClassAsString()
 {
@@ -901,15 +902,15 @@
 /*************************************************************************/
 
 /**
-  * Selects the best supported text flavor on this implementation.
-  * Returns <code>null</code> when none of the given flavors is liked.
-  *
-  * The <code>DataFlavor</code> returned the first data flavor in the
-  * array that has either a representation class which is (a subclass of)
-  * <code>Reader</code> or <code>String</code>, or has a representation
-  * class which is (a subclass of) <code>InputStream</code> and has a
-  * primary MIME type of "text" and has an supported encoding.
-  */
+ * Selects the best supported text flavor on this implementation.
+ * Returns <code>null</code> when none of the given flavors is liked.
+ *
+ * The <code>DataFlavor</code> returned the first data flavor in the
+ * array that has either a representation class which is (a subclass of)
+ * <code>Reader</code> or <code>String</code>, or has a representation
+ * class which is (a subclass of) <code>InputStream</code> and has a
+ * primary MIME type of "text" and has an supported encoding.
+ */
 public static final DataFlavor
 selectBestTextFlavor(DataFlavor[] availableFlavors)
 {
@@ -952,30 +953,30 @@
 /*************************************************************************/
 
 /**
-  * Creates a <code>Reader</code> for a given <code>Transferable</code>.
-  *
-  * If the representation class is a (subclass of) <code>Reader</code>
-  * then an instance of the representation class is returned. If the
-  * representatation class is a <code>String</code> then a
-  * <code>StringReader</code> is returned. And if the representation class
-  * is a (subclass of) <code>InputStream</code> and the primary MIME type
-  * is "text" then a <code>InputStreamReader</code> for the correct charset
-  * encoding is returned.
-  *
-  * @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>,
-  * <code>InputStream</code> and/or the primary MIME type isn't "text".
-  * @exception IOException when any IOException occurs.
-  * @exception UnsupportedEncodingException if the "charset" isn't supported
-  * on this platform.
-  */
+ * Creates a <code>Reader</code> for a given <code>Transferable</code>.
+ *
+ * If the representation class is a (subclass of) <code>Reader</code>
+ * then an instance of the representation class is returned. If the
+ * representatation class is a <code>String</code> then a
+ * <code>StringReader</code> is returned. And if the representation class
+ * is a (subclass of) <code>InputStream</code> and the primary MIME type
+ * is "text" then a <code>InputStreamReader</code> for the correct charset
+ * encoding is returned.
+ *
+ * @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>,
+ * <code>InputStream</code> and/or the primary MIME type isn't "text".
+ * @exception IOException when any IOException occurs.
+ * @exception UnsupportedEncodingException if the "charset" isn't supported
+ * on this platform.
+ */
 public Reader getReaderForText(Transferable transferable)
   throws UnsupportedFlavorException, IOException
 {
Index: java/awt/font/TextHitInfo.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/font/TextHitInfo.java,v
retrieving revision 1.2
diff -u -r1.2 TextHitInfo.java
--- java/awt/font/TextHitInfo.java	7 Nov 2002 08:45:17 -0000	1.2
+++ java/awt/font/TextHitInfo.java	10 Mar 2003 13:20:26 -0000
@@ -39,76 +39,87 @@
 
 /**
  * @author John Leuner <jewel at debian dot org>
- *
- *
  */
-
-public final class TextHitInfo {
-
+public final class TextHitInfo
+{
+  private int charIndex;
+  private boolean leadingEdge;
+  
+  TextHitInfo (int charIndex, boolean leadingEdge)
+  {
+    this.charIndex = charIndex;
+    this.leadingEdge = leadingEdge;
+  }
+  
   public int getCharIndex()
   {
-    return -1;
+    return charIndex;
   }
 
   public boolean isLeadingEdge()
   {
-    return false;
+    return leadingEdge;
   }
 
   public int getInsertionIndex()
   {
-    return -1;
+    return (leadingEdge ? charIndex : charIndex + 1);
   }
 
   public int hashCode()
   {
-    return getCharIndex();
+    return charIndex;
   }
 
   public boolean equals(Object obj)
   {
     if(obj instanceof TextHitInfo)
       return this.equals((TextHitInfo) obj);
+    
     return false;
   }
 
   public boolean equals(TextHitInfo hitInfo)
   {
-    return (getCharIndex() == hitInfo.getCharIndex()) && (isLeadingEdge() == hitInfo.isLeadingEdge());
+    return (charIndex == hitInfo.getCharIndex ())
+            && (leadingEdge == hitInfo.isLeadingEdge ());
   }
 
   public static TextHitInfo leading(int charIndex)
   {
-    return new TextHitInfo();
+    return new TextHitInfo (charIndex, true);
   }
 
   public static TextHitInfo trailing(int charIndex)
   {
-    return new TextHitInfo();
+    return new TextHitInfo (charIndex, false);
   }
 
   public static TextHitInfo beforeOffset(int offset)
   {
-    return new TextHitInfo();
+    return new TextHitInfo (offset, false);
   }
 
   public static TextHitInfo afterOffset(int offset)
   {
-    return new TextHitInfo();
+    return new TextHitInfo (offset, true);
   }
 
   public TextHitInfo getOtherHit()
   {
-    return new TextHitInfo();
+    return (leadingEdge ? trailing (charIndex - 1) : leading (charIndex + 1));
   }
 
   public TextHitInfo getOffsetHit(int offset)
   {
-    return new TextHitInfo();
+    return new TextHitInfo (charIndex + offset, leadingEdge);
   }
 
   public String toString()
   {
-    return "";
+    return "TextHitInfo["
+            + charIndex
+            + (leadingEdge ? "L" : "T" )
+            + "]";
   }
 }
Index: java/awt/image/BufferedImage.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/image/BufferedImage.java,v
retrieving revision 1.5
diff -u -r1.5 BufferedImage.java
--- java/awt/image/BufferedImage.java	22 Jan 2002 22:40:10 -0000	1.5
+++ java/awt/image/BufferedImage.java	10 Mar 2003 13:20:26 -0000
@@ -53,8 +53,8 @@
  * 
  * @author Rolf W. Rasmussen <rolfwr at ii dot uib dot no>
  */
-public class BufferedImage extends java.awt.Image
-    //implements java.awt.image.WritableRenderedImage
+public class BufferedImage extends Image
+  implements WritableRenderedImage
 {
   public static final int TYPE_CUSTOM         =  0,
                           TYPE_INT_RGB        =  1,
@@ -88,6 +88,8 @@
 				   0x03e0,
 				   0x001f,
 				   DataBuffer.TYPE_USHORT};
+
+  Vector observers;
   
   public BufferedImage(int w, int h, int type)
   {
@@ -568,5 +570,34 @@
   {
     // FIXME: implement:
     return super.toString();
+  }
+
+  /**
+   * Adds a tile observer. If the observer is already present, it receives
+   * multiple notifications.
+   *
+   * @param to The TileObserver to add.
+   */
+  public void addTileObserver (TileObserver to)
+  {
+    if (observers == null)
+      observers = new Vector ();
+	
+    observers.add (to);
+  }
+	
+  /**
+   * Removes a tile observer. If the observer was not registered,
+   * nothing happens. If the observer was registered for multiple
+   * notifications, it is now registered for one fewer notification.
+   *
+   * @param to The TileObserver to remove.
+   */
+  public void removeTileObserver (TileObserver to)
+  {
+    if (observers == null)
+      return;
+	
+    observers.remove (to);
   }
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]