*/
protected Animation buildHorizontalAnimation(final double fromX, final double toX, final double fromY, final double toY) {
final double angle = findAngle(fromX, toX, fromY, toY);
final MotionBlur mb = MotionBlurBuilder.create().angle(angle).build();
getRootNode().setEffect(mb);
return ParallelTransitionBuilder.create()
.children(
TranslateTransitionBuilder.create()
.node(getRootNode())
.fromX(fromX)
.toX(toX)
.fromY(fromY)
.toY(toY)
.duration(Duration.seconds(1))
.build(),
TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0), new KeyValue(mb.radiusProperty(), 0)),
new KeyFrame(Duration.millis(100), new KeyValue(mb.radiusProperty(), 50)),
new KeyFrame(Duration.millis(500), new KeyValue(mb.radiusProperty(), 63)),
new KeyFrame(Duration.millis(900), new KeyValue(mb.radiusProperty(), 50)),
new KeyFrame(Duration.millis(1000), new KeyValue(mb.radiusProperty(), 0))
)
.build()
)
.build();
}