/* * Main.fx * * Created on Mar 20, 2009, 10:38:36 AM */ package transitions; import javafx.animation.transition.FadeTransition; import javafx.animation.transition.PauseTransition; import javafx.animation.transition.RotateTransition; import javafx.animation.transition.ScaleTransition; import javafx.animation.transition.SequentialTransition; import javafx.animation.transition.TranslateTransition; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.Scene; import javafx.stage.Stage; /** * @author Vaibhav Choudhary */ var node = ImageView { translateX: 50 translateY: 50 image: Image { url: "{__DIR__}car.png" } } var seqTransition = SequentialTransition { node: node content: [ PauseTransition { duration: 1s }, // wait a second FadeTransition { duration: 1s fromValue: 1.0 toValue: 0.3 repeatCount: 2 autoReverse: true }, TranslateTransition { duration: 1s byX: 100 repeatCount: 1 }, RotateTransition { duration: 1s byAngle: 90 repeatCount: 1 }, TranslateTransition { duration: 1s byY: 100 repeatCount: 1 }, ScaleTransition { duration: 2s node: node byX: 1.5 byY: 1.5 repeatCount: 2 autoReverse: true }, ] } seqTransition.play(); Stage { title: "Seq. Transitions" width: 550 height: 580 scene: Scene { content: [ node ] } }