Top Description Fields Constructors Methods
com.sun.glass.ui.monocle

public Class X11Cursor

extends NativeCursor
Class Inheritance
Known Direct Subclasses
com.sun.glass.ui.monocle.X11WarpingCursor
Imports
com.sun.glass.ui.Size, java.nio.ByteBuffer

Provides a native cursor for use with X11. Since X11 doesn't provide any programmatic way to dynamically hide/show the cursor, we use a workaround of creating a 1x1 transparent pixmap cursor which we activate whenever we want to hide the cursor.

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private long
private long
private ByteBuffer
protected long
private static X
protected long
Inherited from com.sun.glass.ui.monocle.NativeCursor:
isVisible

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Size
getBestSize()

Implements abstract com.sun.glass.ui.monocle.NativeCursor.getBestSize.

Returns the preferred size of a native cursor.

pack-priv void
setHotSpot(int hotspotX, int hotspotY)

Implements abstract com.sun.glass.ui.monocle.NativeCursor.setHotSpot.

Sets the offset of the cursor's hot spot within the cursor image The hot spot offsets default to 0, 0.

pack-priv void
setImage(byte[]
the cursor image, in BYTE_BGRA_PRE format
cursorImage
)

Implements abstract com.sun.glass.ui.monocle.NativeCursor.setImage.

Set the cursor image to the requested bytes

pack-priv void
setLocation(int
the new X location on the screen
x
,
int
the new Y location on the screen
y
)

Implements abstract com.sun.glass.ui.monocle.NativeCursor.setLocation.

For the X11 cursor, we don't do anything to move the cursor - X handles it for us

pack-priv void
setVisibility(boolean
the new setting for the cursor's visibility.
visibility
)

Implements abstract com.sun.glass.ui.monocle.NativeCursor.setVisibility.

Set the cursor according to the current visibility and requested visibility

pack-priv void
shutdown()

Implements abstract com.sun.glass.ui.monocle.NativeCursor.shutdown.

Performs any necessary shutdown of the cursor infrastructure.

Inherited from com.sun.glass.ui.monocle.NativeCursor:
getVisiblity

Field Detail

CURSOR_HEIGHTback to summary
private static final int CURSOR_HEIGHT
CURSOR_WIDTHback to summary
private static final int CURSOR_WIDTH
pixmapback to summary
private long pixmap
transparentCursorback to summary
private long transparentCursor
transparentCursorBufferback to summary
private ByteBuffer transparentCursorBuffer
xdisplayback to summary
protected long xdisplay
xLibback to summary
private static X xLib
xwindowback to summary
protected long xwindow

Constructor Detail

X11Cursorback to summary
pack-priv X11Cursor()

Method Detail

getBestSizeback to summary
pack-priv Size getBestSize()

Implements abstract com.sun.glass.ui.monocle.NativeCursor.getBestSize.

Doc from com.sun.glass.ui.monocle.NativeCursor.getBestSize.

Returns the preferred size of a native cursor.

Annotations
@Override
setHotSpotback to summary
pack-priv void setHotSpot(int hotspotX, int hotspotY)

Implements abstract com.sun.glass.ui.monocle.NativeCursor.setHotSpot.

Doc from com.sun.glass.ui.monocle.NativeCursor.setHotSpot.

Sets the offset of the cursor's hot spot within the cursor image The hot spot offsets default to 0, 0.

Annotations
@Override
setImageback to summary
pack-priv void setImage(byte[] cursorImage)

Implements abstract com.sun.glass.ui.monocle.NativeCursor.setImage.

Set the cursor image to the requested bytes

Parameters
cursorImage:byte[]

the cursor image, in BYTE_BGRA_PRE format

Annotations
@Override
setLocationback to summary
pack-priv void setLocation(int x, int y)

Implements abstract com.sun.glass.ui.monocle.NativeCursor.setLocation.

For the X11 cursor, we don't do anything to move the cursor - X handles it for us

Parameters
x:int

the new X location on the screen

y:int

the new Y location on the screen

Annotations
@Override
setVisibilityback to summary
pack-priv void setVisibility(boolean visibility)

Implements abstract com.sun.glass.ui.monocle.NativeCursor.setVisibility.

Set the cursor according to the current visibility and requested visibility

Parameters
visibility:boolean

the new setting for the cursor's visibility.

Annotations
@Override
shutdownback to summary
pack-priv void shutdown()

Implements abstract com.sun.glass.ui.monocle.NativeCursor.shutdown.

Doc from com.sun.glass.ui.monocle.NativeCursor.shutdown.

Performs any necessary shutdown of the cursor infrastructure. Called only once.

Annotations
@Override