Package org.eclipse.swt.graphics
Class Cursor
java.lang.Object
org.eclipse.swt.graphics.Resource
org.eclipse.swt.graphics.Cursor
Instances of this class manage operating system resources that specify the
appearance of the on-screen pointer.
To obtain cursors, it is recommended to use one of the
getSystemCursor method from class Display.
- Styles:
- CURSOR_ARROW, CURSOR_WAIT, CURSOR_CROSS, CURSOR_APPSTARTING, CURSOR_HELP, CURSOR_SIZEALL, CURSOR_SIZENESW, CURSOR_SIZENS, CURSOR_SIZENWSE, CURSOR_SIZEWE, CURSOR_SIZEN, CURSOR_SIZES, CURSOR_SIZEE, CURSOR_SIZEW, CURSOR_SIZENE, CURSOR_SIZESE, CURSOR_SIZESW, CURSOR_SIZENW, CURSOR_UPARROW, CURSOR_IBEAM, CURSOR_NO, CURSOR_HAND
Note: Only one of the above styles may be specified.
- Since:
- 1.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.inthashCode()Returns an integer hash code for the receiver.toString()Returns a string containing a concise, human-readable description of the receiver.Methods inherited from class org.eclipse.swt.graphics.Resource
dispose, getDevice, isDisposed
-
Constructor Details
-
Cursor
Constructs a new cursor given a device and a style constant describing the desired cursor appearance.You must dispose the cursor when it is no longer required.
NOTE: It is recommended to useDisplay.getSystemCursor(int)instead of using this constructor. This way you can avoid the overhead of disposing the Cursor resource.- Parameters:
device- the device on which to allocate the cursorstyle- the style of cursor to allocate- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if device is null and there is no current device
- ERROR_INVALID_ARGUMENT - when an unknown style is specified
SWTError-- ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation
- Since:
- 1.3
- See Also:
-
SWT.CURSOR_ARROWSWT.CURSOR_WAITSWT.CURSOR_CROSSSWT.CURSOR_APPSTARTINGSWT.CURSOR_HELPSWT.CURSOR_SIZEALLSWT.CURSOR_SIZENESWSWT.CURSOR_SIZENSSWT.CURSOR_SIZENWSESWT.CURSOR_SIZEWESWT.CURSOR_SIZENSWT.CURSOR_SIZESSWT.CURSOR_SIZEESWT.CURSOR_SIZEWSWT.CURSOR_SIZENESWT.CURSOR_SIZESESWT.CURSOR_SIZESWSWT.CURSOR_SIZENWSWT.CURSOR_UPARROWSWT.CURSOR_IBEAMSWT.CURSOR_NOSWT.CURSOR_HANDDisplay.getSystemCursor(int)
-
-
Method Details
-
equals
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. -
hashCode
public int hashCode()Returns an integer hash code for the receiver. Any two objects that returntruewhen passed toequalsmust return the same value for this method. -
toString
Returns a string containing a concise, human-readable description of the receiver.
-