Class Cursor
 Application code must explicitly invoke the Cursor.dispose()
 method to release the operating system resources managed by each instance
 when those instances are no longer required.
 
- 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.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new cursor given a device and a style constant describing the desired cursor appearance.Constructs a new cursor given a device, image data describing the desired cursor appearance, and the x and y coordinates of the hotspot (that is, the point within the area covered by the cursor which is considered to be where the on-screen pointer is "pointing").Cursor(Device device, ImageDataProvider imageDataProvider, int hotspotX, int hotspotY) Constructs a new cursor given a device, image describing the desired cursor appearance, and the x and y coordinates of the hotspot (that is, the point within the area covered by the cursor which is considered to be where the on-screen pointer is "pointing").Constructs a new cursor given a device, image and mask data describing the desired cursor appearance, and the x and y coordinates of the hotspot (that is, the point within the area covered by the cursor which is considered to be where the on-screen pointer is "pointing").
- 
Method SummaryModifier 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.booleanReturnstrueif the cursor has been disposed, andfalseotherwise.toString()Returns a string containing a concise, human-readable description of the receiver.static Longwin32_getHandle(Cursor cursor, int zoom) IMPORTANT: This method is not part of the public API for Image.Methods inherited from class org.eclipse.swt.graphics.Resourcedispose, getDevice, setNonDisposeHandler
- 
Constructor Details- 
CursorConstructs 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 cursor
- style- 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
 
- See Also:
 
- 
CursorConstructs a new cursor given a device, image and mask data describing the desired cursor appearance, and the x and y coordinates of the hotspot (that is, the point within the area covered by the cursor which is considered to be where the on-screen pointer is "pointing").The mask data is allowed to be null, but in this case the source must be an ImageData representing an icon that specifies both color data and mask data. You must dispose the cursor when it is no longer required. - Parameters:
- device- the device on which to allocate the cursor
- source- the color data for the cursor
- mask- the mask data for the cursor (or null)
- hotspotX- the x coordinate of the cursor's hotspot
- hotspotY- the y coordinate of the cursor's hotspot
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if device is null and there is no current device
- ERROR_NULL_ARGUMENT - if the source is null
- ERROR_NULL_ARGUMENT - if the mask is null and the source does not have a mask
- ERROR_INVALID_ARGUMENT - if the source and the mask are not the same size, or if the hotspot is outside the bounds of the image
 
- SWTError-- ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation
 
- See Also:
 
- 
CursorConstructs a new cursor given a device, image data describing the desired cursor appearance, and the x and y coordinates of the hotspot (that is, the point within the area covered by the cursor which is considered to be where the on-screen pointer is "pointing").You must dispose the cursor when it is no longer required. - Parameters:
- device- the device on which to allocate the cursor
- source- the image data for the cursor
- hotspotX- the x coordinate of the cursor's hotspot
- hotspotY- the y coordinate of the cursor's hotspot
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if device is null and there is no current device
- ERROR_NULL_ARGUMENT - if the image is null
- ERROR_INVALID_ARGUMENT - if the hotspot is outside the bounds of the image
 
- SWTError-- ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation
 
- Since:
- 3.0
- See Also:
 
- 
CursorConstructs a new cursor given a device, image describing the desired cursor appearance, and the x and y coordinates of the hotspot (that is, the point within the area covered by the cursor which is considered to be where the on-screen pointer is "pointing").You must dispose the cursor when it is no longer required. - Parameters:
- device- the device on which to allocate the cursor
- imageDataProvider- the ImageDataProvider for the cursor
- hotspotX- the x coordinate of the cursor's hotspot
- hotspotY- the y coordinate of the cursor's hotspot
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if device is null and there is no current device
- ERROR_NULL_ARGUMENT - if the image is null
- ERROR_INVALID_ARGUMENT - if the hotspot is outside the bounds of the image
 
- SWTError-- ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation
 
- Since:
- 3.131
- See Also:
 
 
- 
- 
Method Details- 
win32_getHandleIMPORTANT: This method is not part of the public API for Image. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. Get the handle for a cursor given a zoom level.- Parameters:
- cursor- the cursor
- zoom- zoom level (in %) of the monitor the cursor is currently in.
- Returns:
- The handle of the cursor.
- Restriction:
- This method is not intended to be referenced by clients.
 
- 
equalsCompares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
- 
hashCodepublic int hashCode()Returns an integer hash code for the receiver. Any two objects that returntruewhen passed toequalsmust return the same value for this method.
- 
isDisposedpublic boolean isDisposed()Returnstrueif the cursor has been disposed, andfalseotherwise.This method gets the dispose state for the cursor. When a cursor has been disposed, it is an error to invoke any other method (except Resource.dispose()) using the cursor.- Specified by:
- isDisposedin class- Resource
- Returns:
- truewhen the cursor is disposed and- falseotherwise
 
- 
toStringReturns a string containing a concise, human-readable description of the receiver.
 
-