Generated Object
Creates a javafx.animation.KeyFrame instance.
Value
This object takes a duration value.
Attributes
This node takes the attributes defined on the javafx.animation.KeyFrame class. see javafx.animation.KeyFrame
The onFinished attribute may take either a javafx.event.EventHandler object or a groovy closure object. The groovy closure will be called with the javafx.event.Event object as a single argument..
Content
This node may take one or more *change *nodes. see
Usage
Creates a timeline KeyFrame.
Examples
| Code Block |
|---|
import groovyx.javafx.TimelineBuilder;
import javafx.animation.Interpolator;
import groovyx.javafx.GroovyFX
import org.codehaus.groovyfx.javafx.binding.PropertyBinding;
import javafx.application.Platform;
x = 5.0;
y = 5.0;
GroovyFX.start({
def tlb = new TimelineBuilder();
def tl = tlb.timeline(cycleCount: 2, onFinished: { Platform.exit()}) {
at (10.s,
onFinished: { println "x = ${this.x}, y = ${this.y}"}
)
{
change (this,"x") {
to 2.0
tween "ease_both"
}
change (this,"y") {
to 125
}
}
}
println( tl )
tl.play();
});
|