Class FillTransition

java.lang.Object

public final class FillTransition extends Transition
This Transition creates an animation, that changes the filling of a shape over a duration. This is done by updating the fill variable of the shape at regular intervals.

It starts from the fromValue if provided else uses the shape 's fill value. (The stroke value has to be a Color in this case).

It stops at the toValue value.

Code Segment Example:

 
 import javafx.scene.shape.*;
 import javafx.animation.*;

 ...

     Rectangle rect = new Rectangle (100, 40, 100, 100);
     rect.setArcHeight(50);
     rect.setArcWidth(50);

     FillTransition ft = new FillTransition(Duration.millis(3000), rect, Color.RED, Color.BLUE);
     ft.setCycleCount(4);
     ft.setAutoReverse(true);

     ft.play();

 ...

 
 
Since:
JavaFX 2.0
See Also: