public class FXPanOnScrollPolicy extends AbstractFXOnScrollPolicy
FXPanOnScrollPolicy
is an AbstractFXOnScrollPolicy
that
pans (i.e. moves/scrolls) the viewport upon scrolling the mouse wheel.Constructor and Description |
---|
FXPanOnScrollPolicy() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyPanning(double dx,
double dy)
Applies the given translation to the viewport.
|
protected Dimension |
computeDelta(javafx.scene.input.ScrollEvent event)
Computes the translation for the given
ScrollEvent . |
protected boolean |
isSuitable(javafx.scene.input.ScrollEvent event)
Returns
true if the given ScrollEvent should trigger
panning. |
protected boolean |
isSwapDirection(javafx.scene.input.ScrollEvent event)
Returns
true if the pan direction should be inverted for the
given ScrollEvent . |
void |
scroll(javafx.scene.input.ScrollEvent event)
This callback method is invoked when the user performs mouse scrolling
over the
host . |
commit, disableRefreshVisuals, enableRefreshVisuals, getAdaptable, getHost, init, setAdaptable
protected void applyPanning(double dx, double dy)
dx
- The horizontal translation.dy
- The vertical translation.protected Dimension computeDelta(javafx.scene.input.ScrollEvent event)
ScrollEvent
. The
horizontal and vertical translation is inverted when
isSwapDirection(ScrollEvent)
returns true
.event
- The original ScrollEvent
.Dimension
storing the horizontal and vertical
translation.protected boolean isSuitable(javafx.scene.input.ScrollEvent event)
true
if the given ScrollEvent
should trigger
panning. Otherwise returns false
.event
- The ScrollEvent
in question.true
to indicate that the given ScrollEvent
should trigger panning, otherwise false
.protected boolean isSwapDirection(javafx.scene.input.ScrollEvent event)
true
if the pan direction should be inverted for the
given ScrollEvent
. Otherwise returns false
.event
- The ScrollEvent
in question.true
if the pan direction should be inverted,
otherwise false
.public void scroll(javafx.scene.input.ScrollEvent event)
AbstractFXOnScrollPolicy
host
.scroll
in class AbstractFXOnScrollPolicy
event
- The original ScrollEvent
.Copyright (c) 2014 itemis AG and others. All rights reserved.