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
This commit is contained in:
parent
f6f1dc952a
commit
c1ef066249
2 changed files with 16 additions and 3 deletions
|
@ -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>
|
2001-01-11 Bryce McKinlay <bryce@albatross.co.nz>
|
||||||
|
|
||||||
* Makefile.am: Re-enable dependencies.
|
* Makefile.am: Re-enable dependencies.
|
||||||
|
|
|
@ -36,6 +36,8 @@ public class Cursor implements java.io.Serializable
|
||||||
|
|
||||||
public Cursor(int type)
|
public Cursor(int type)
|
||||||
{
|
{
|
||||||
|
if (type < 0 || type >= PREDEFINED_COUNT)
|
||||||
|
throw new IllegalArgumentException ("invalid cursor " + type);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
// FIXME: lookup and set name?
|
// FIXME: lookup and set name?
|
||||||
}
|
}
|
||||||
|
@ -46,13 +48,13 @@ public class Cursor implements java.io.Serializable
|
||||||
protected Cursor(String name)
|
protected Cursor(String name)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
// FIXME
|
this.type = CUSTOM_CURSOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Cursor getPredefinedCursor(int type)
|
public static Cursor getPredefinedCursor(int type)
|
||||||
{
|
{
|
||||||
if (type >= PREDEFINED_COUNT)
|
if (type < 0 || type >= PREDEFINED_COUNT)
|
||||||
return null;
|
throw new IllegalArgumentException ("invalid cursor " + type);
|
||||||
if (predefined[type] == null)
|
if (predefined[type] == null)
|
||||||
predefined[type] = new Cursor(type);
|
predefined[type] = new Cursor(type);
|
||||||
return predefined[type];
|
return predefined[type];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue