public class FXZoomOnScrollPolicy extends AbstractFXOnScrollPolicy
FXZoomOnScrollPolicy is an AbstractFXOnScrollPolicy that
scales the viewport when the user scroll with the mouse wheel while pressing
either <Control> or <Alt>.| Constructor and Description |
|---|
FXZoomOnScrollPolicy() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isZoom(javafx.scene.input.ScrollEvent event)
Returns
true if the given ScrollEvent should trigger
zooming. |
void |
scroll(javafx.scene.input.ScrollEvent event)
This callback method is invoked when the user performs mouse scrolling
over the
host. |
void |
zoomRelative(double relativeZoom,
double sceneX,
double sceneY)
Scales the viewport by the given relativeZoom factor around the
given pivot point in scene coordinates.
|
commit, disableRefreshVisuals, enableRefreshVisuals, getAdaptable, getHost, init, setAdaptableprotected boolean isZoom(javafx.scene.input.ScrollEvent event)
true if the given ScrollEvent should trigger
zooming. Otherwise returns false. Per default, either
<Control> or <Alt> has to be
pressed so that true is returned.event - The ScrollEvent in question.true if the given ScrollEvent should trigger
zooming, otherwise false.public void scroll(javafx.scene.input.ScrollEvent event)
AbstractFXOnScrollPolicyhost.scroll in class AbstractFXOnScrollPolicyevent - The original ScrollEvent.public void zoomRelative(double relativeZoom,
double sceneX,
double sceneY)
relativeZoom - The scale factor.sceneX - The pivot x-coordinate.sceneY - The pivot y-coordinate.Copyright (c) 2014 itemis AG and others. All rights reserved.