jcurzez
Class Cursor

java.lang.Object
  |
  +--jcurzez.Cursor

public final class Cursor
extends java.lang.Object

Every window has a cursor. The cursor can be moved and hidden.

Version:
0.0.3
Author:
Thomas Girard
See Also:
Pen

Field Summary
static int INVISIBLE
          Cursor is not visible.
static int NORMAL
          Cursor is visible.
(package private)  Rectangle rectangle
          The rectangle this cursor is attached to.
static int VERY_VISIBLE
          Cursor is very visible.
private  int visibility
          visibility of the cursor.
(package private)  int x
          x coordinate of the cursor.
(package private)  int y
          y coordinate of the cursor.
 
Constructor Summary
Cursor(Rectangle rectangle, int initialX, int initialY)
          Constructs a new cursor for specified rectangle, with initial position (initialX, initialY).
 
Method Summary
 int getCursorVisibility()
          Retrieves the cursor visibility.
 int getX()
          Retrieves the current X coordinate of the cursor.
 int getY()
          Retrieves the current Y coordinate of the cursor.
 void setCursorVisibility(int visible)
          Changes cursor visibility.
 void setX(int x)
          Changes the current X coordinate of the cursor.
 void setXY(int x, int y)
          Changes both the current X and current Y coordinates of the cursor.
 void setY(int y)
          Changes the current Y coordinate of the cursor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rectangle

final Rectangle rectangle
The rectangle this cursor is attached to.


visibility

private int visibility
visibility of the cursor.


x

int x
x coordinate of the cursor.


y

int y
y coordinate of the cursor.


INVISIBLE

public static final int INVISIBLE
Cursor is not visible.


NORMAL

public static final int NORMAL
Cursor is visible.


VERY_VISIBLE

public static final int VERY_VISIBLE
Cursor is very visible.

Constructor Detail

Cursor

public Cursor(Rectangle rectangle,
              int initialX,
              int initialY)
Constructs a new cursor for specified rectangle, with initial position (initialX, initialY).

Parameters:
rectangle - the rectangle this cursor is attached to.
initialX - the initial x position of the cursor.
initialY - the initial y position of the cursor.
Method Detail

getX

public int getX()
Retrieves the current X coordinate of the cursor.

Returns:
the current X coordinate of the cursor.

getY

public int getY()
Retrieves the current Y coordinate of the cursor.

Returns:
the current Y coordinate of the cursor.

setX

public void setX(int x)
Changes the current X coordinate of the cursor.

Parameters:
x - the new X coordinate of the cursor.
Throws:
InconsistentCoordinateException - if x is not consistent.

setY

public void setY(int y)
Changes the current Y coordinate of the cursor.

Parameters:
y - the new Y coordinate of the cursor.
Throws:
InconsistentCoordinateException - if y is not consistent.

setXY

public void setXY(int x,
                  int y)
Changes both the current X and current Y coordinates of the cursor.

Parameters:
x - the new X coordinate of the cursor.
y - the new Y coordinate of the cursor.
Throws:
InconsistentCoordinateException - if x or y is not consistent.

setCursorVisibility

public void setCursorVisibility(int visible)
Changes cursor visibility.

Parameters:
visible - the cursor visibility.
Throws:
java.lang.IllegalArgumentException - if visible is not consistent.

getCursorVisibility

public int getCursorVisibility()
Retrieves the cursor visibility.

Returns:
the cursor visibility.


Send me an email