public class CursorSupport
extends java.lang.Object
CursorSupport
provides methods for changing and restoring the
mouse cursor. It is designed to be used from within an IPolicy
implementation.Constructor and Description |
---|
CursorSupport(IPolicy<javafx.scene.Node> hostPolicy)
Creates a new
CursorSupport that can be used to change and keep
track of the mouse cursor for the given IPolicy . |
Modifier and Type | Method and Description |
---|---|
javafx.scene.Cursor |
getOriginalCursor()
Returns the original mouse
Cursor that is stored by this policy. |
boolean |
isCursorChanged()
Returns
true if the mouse cursor was changed by this policy. |
void |
restoreCursor()
Restores the mouse
Cursor that was replaced by a previous
storeAndReplaceCursor(Cursor) call. |
void |
setCursor(javafx.scene.Cursor cursor)
Sets the given
Cursor as the mouse cursor for the Scene
of the host visual. |
void |
storeAndReplaceCursor(javafx.scene.Cursor cursor)
Changes the mouse
Cursor to the given value if necessary. |
public CursorSupport(IPolicy<javafx.scene.Node> hostPolicy)
CursorSupport
that can be used to change and keep
track of the mouse cursor for the given IPolicy
.hostPolicy
- The policy that is supported.public javafx.scene.Cursor getOriginalCursor()
Cursor
that is stored by this policy.Cursor
that is stored by this policy.public boolean isCursorChanged()
true
if the mouse cursor was changed by this policy.
Otherwise returns false
.true
if the mouse cursor was changed by this policy,
Otherwise false
.public void restoreCursor()
Cursor
that was replaced by a previous
storeAndReplaceCursor(Cursor)
call. If the mouse Cursor
has never been replaced, it is not changed.storeAndReplaceCursor(Cursor)
public void setCursor(javafx.scene.Cursor cursor)
Cursor
as the mouse cursor for the Scene
of the host visual. Note that this method does not store the original
mouse cursor.cursor
- The new mouse Cursor
.storeAndReplaceCursor(Cursor)
,
restoreCursor()
public void storeAndReplaceCursor(javafx.scene.Cursor cursor)
Cursor
to the given value if necessary. If this
method is called for the first time (in general or for the first time
after a call to restoreCursor()
) the original cursor is stored
so that it can later be restored.cursor
- The new mouse Cursor
.restoreCursor()
Copyright (c) 2014 itemis AG and others. All rights reserved.