public class FXCursorBehavior extends AbstractBehavior<javafx.scene.Node>
FXCursorBehavior
can be used to change the mouse cursor depending
on the currently pressed modifier keys.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CURSOR_PROVIDER_ROLE
Role name for the
Provider<Map<KeyCode, Cursor>>
which can be registered on an IVisualPart to provide the mouse
Cursor s for the individual modifier keys. |
pcs
ACTIVE_PROPERTY
Constructor and Description |
---|
FXCursorBehavior()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate() |
protected void |
changeCursor(javafx.scene.Cursor cursor)
Changes the mouse cursor to the given
Cursor and saves the
initial mouse cursor so that it can later be restored. |
void |
deactivate() |
protected com.google.inject.Provider<java.util.Map<javafx.scene.input.KeyCode,javafx.scene.Cursor>> |
getCursorProvider()
Returns the
Provider<Map<KeyCode, Cursor>> which
is registered on the host under the
CURSOR_PROVIDER_ROLE role. |
protected void |
restoreInitialCursor()
Restores the initial mouse cursor.
|
addFeedback, addFeedback, addHandles, addHandles, addPropertyChangeListener, getAdaptable, getFeedbackParts, getHandleParts, getHost, isActive, removeFeedback, removeHandles, removePropertyChangeListener, setAdaptable, switchAdaptableScopes
public static final java.lang.String CURSOR_PROVIDER_ROLE
Provider<Map<KeyCode, Cursor>>
which can be registered on an IVisualPart
to provide the mouse
Cursor
s for the individual modifier keys.public void activate()
activate
in interface IActivatable
activate
in class AbstractBehavior<javafx.scene.Node>
protected void changeCursor(javafx.scene.Cursor cursor)
Cursor
and saves the
initial mouse cursor so that it can later be restored.cursor
- The new mouse Cursor
.public void deactivate()
deactivate
in interface IActivatable
deactivate
in class AbstractBehavior<javafx.scene.Node>
protected com.google.inject.Provider<java.util.Map<javafx.scene.input.KeyCode,javafx.scene.Cursor>> getCursorProvider()
Provider<Map<KeyCode, Cursor>>
which
is registered on the host
under the
CURSOR_PROVIDER_ROLE
role.Provider<Map<KeyCode, Cursor>>
which
is registered on the host
under the
CURSOR_PROVIDER_ROLE
role.protected void restoreInitialCursor()
Copyright (c) 2014 itemis AG and others. All rights reserved.