Class StrokeTransition

java.lang.Object
javafx.animation.Animation
javafx.animation.Transition
javafx.animation.StrokeTransition

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

It starts from the fromValue if provided else uses the shape 's stroke 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);
     rect.setFill(null);

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

     st.play();

 ...

 
 
Since:
JavaFX 2.0
See Also: