/* * Time.fx * * Created on Mar 18, 2009, 3:00:14 PM */ package timelineproblem; import javafx.animation.Interpolator; import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.scene.CustomNode; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.paint.Color; import javafx.scene.paint.RadialGradient; import javafx.scene.paint.Stop; import javafx.scene.shape.Circle; /** * @author Vaibhav Choudhary */ public class Time extends CustomNode { public var v = 0.0; public var t = Timeline { repeatCount: 1 keyFrames: [ KeyFrame { time: 1s canSkip: true values: [ v => 100.0 tween Interpolator.LINEAR ] } ] } public override function create(): Node { return Group { content: [ Circle { translateX: bind v centerX: 50, centerY: 50 radius: 20 fill: RadialGradient { centerX: 0.25 centerY: 0.25 stops: [ Stop { color: Color.WHITE offset: 0.0 }, Stop { color: Color.BLACK offset: 1.0 }, ] } } ] }; } }