public class FXPanOnTypePolicy extends AbstractFXOnTypePolicy
FXPanOnTypePolicy
is an AbstractFXOnTypePolicy
that
performs viewport panning via the keyboard.Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_SCROLL_AMOUNT_PER_SECOND
The default scroll amount per second, i.e. how many pixels the viewport
is moved per second.
|
Constructor and Description |
---|
FXPanOnTypePolicy() |
Modifier and Type | Method and Description |
---|---|
double |
getScrollAmountPerSecond()
Returns the amount of units scrolled per second when a direction key is
pressed.
|
protected ViewportModel |
getViewportModel()
|
void |
pressed(javafx.scene.input.KeyEvent event)
This callback method is invoked when the user presses a key while the
host has keyboard focus. |
void |
released(javafx.scene.input.KeyEvent event)
This callback method is invoked when the user releases a key while the
host has keyboard focus. |
protected void |
updateScrollPosition()
Computes the viewport translation and applies it to the
viewport model . |
commit, disableRefreshVisuals, enableRefreshVisuals, getAdaptable, getHost, init, setAdaptable
public static final double DEFAULT_SCROLL_AMOUNT_PER_SECOND
public double getScrollAmountPerSecond()
protected ViewportModel getViewportModel()
ViewportModel
of the IViewer
which the
host
belongs to.public void pressed(javafx.scene.input.KeyEvent event)
AbstractFXOnTypePolicy
host
has keyboard focus.pressed
in class AbstractFXOnTypePolicy
event
- The original KeyEvent
.public void released(javafx.scene.input.KeyEvent event)
AbstractFXOnTypePolicy
host
has keyboard focus.released
in class AbstractFXOnTypePolicy
event
- The original KeyEvent
.protected void updateScrollPosition()
viewport model
.Copyright (c) 2014 itemis AG and others. All rights reserved.