Java examples for JavaFX:Animation
Adds a zoom behavior (zoom by scroll) to the specified JavaFX node.
import javafx.event.EventHandler; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.input.ScrollEvent; import javafx.scene.transform.Rotate; import javafx.scene.transform.Translate; public class Main{ /**// w w w .j a v a2s. c o m * Adds a zoom behavior (zoom by scroll) to the specified node. * @param n node * @param eventReceiver receiver of the event */ public static void addZoomBehavior(Node n, Node eventReceiver) { eventReceiver.addEventHandler(ScrollEvent.ANY, new ZoomBehavior(n)); } }