Cursor.java (Cursor(String)): Set type to custom.
authorTom Tromey <tromey@redhat.com>
Thu, 11 Jan 2001 17:49:47 +0000 (17:49 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 11 Jan 2001 17:49:47 +0000 (17:49 +0000)
* java/awt/Cursor.java (Cursor(String)): Set type to custom.
(Cursor(int), getPredefinedCursor): Throw exception if argument
invalid.

From-SVN: r38911

libjava/ChangeLog
libjava/java/awt/Cursor.java

index 4363eb88024f722b5bec5a7a4bd6877af518c9df..06e298e1d95db2cae2191056216dfae3e430a49e 100644 (file)
@@ -1,3 +1,14 @@
+2001-01-11  Tom Tromey  <tromey@redhat.com>
+
+       * java/awt/Cursor.java (Cursor(String)): Set type to custom.
+       (Cursor(int), getPredefinedCursor): Throw exception if argument
+       invalid.
+
+2001-01-03  Tom Tromey  <tromey@redhat.com>
+
+       * gnu/awt/gtk/natGtkComponentPeer.cc (setCursor): Wrote.
+       (getLocationOnScreen): Wrote.
+
 2001-01-11  Bryce McKinlay  <bryce@albatross.co.nz>
 
        * Makefile.am: Re-enable dependencies.
index e964a12d15f3faaf6489438ecffd301b2e437ad0..80f28e6ed733cd5fd40bf8622b8f8875bf9cfada 100644 (file)
@@ -36,6 +36,8 @@ public class Cursor implements java.io.Serializable
 
   public Cursor(int type)
   {
+    if (type < 0 || type >= PREDEFINED_COUNT)
+      throw new IllegalArgumentException ("invalid cursor " + type);
     this.type = type;
     // FIXME: lookup and set name?
   }
@@ -46,13 +48,13 @@ public class Cursor implements java.io.Serializable
   protected Cursor(String name)
   {
     this.name = name;
-    // FIXME
+    this.type = CUSTOM_CURSOR;
   }
 
   public static Cursor getPredefinedCursor(int type)
   {
-    if (type >= PREDEFINED_COUNT)
-      return null;
+    if (type < 0 || type >= PREDEFINED_COUNT)
+      throw new IllegalArgumentException ("invalid cursor " + type);
     if (predefined[type] == null)
       predefined[type] = new Cursor(type);
     return predefined[type];