aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-01-11 17:49:47 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-01-11 17:49:47 +0000
commitc1ef0662493dd83fe23f7235fa085f2d4e054b3c (patch)
tree813e7e2d1e7466679c0eea1808578ad44322878e /libjava
parentf6f1dc952aa1a072aa01938af7083dc0c38950f1 (diff)
downloadgcc-c1ef0662493dd83fe23f7235fa085f2d4e054b3c.zip
gcc-c1ef0662493dd83fe23f7235fa085f2d4e054b3c.tar.gz
gcc-c1ef0662493dd83fe23f7235fa085f2d4e054b3c.tar.bz2
Cursor.java (Cursor(String)): Set type to custom.
* java/awt/Cursor.java (Cursor(String)): Set type to custom. (Cursor(int), getPredefinedCursor): Throw exception if argument invalid. From-SVN: r38911
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog11
-rw-r--r--libjava/java/awt/Cursor.java8
2 files changed, 16 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 4363eb8..06e298e 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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.
diff --git a/libjava/java/awt/Cursor.java b/libjava/java/awt/Cursor.java
index e964a12..80f28e6 100644
--- a/libjava/java/awt/Cursor.java
+++ b/libjava/java/awt/Cursor.java
@@ -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];