Here are the examples of the java api javafx.animation.FillTransition.play() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
15
Source : ComponentStackPane.java
with GNU General Public License v3.0
from Simulizer
with GNU General Public License v3.0
from Simulizer
/**
* Highlights the shape to a red colour and back
*/
public void highlight() {
Platform.runLater(() -> {
FillTransition ft = new FillTransition(Duration.millis(100), shape, Color.valueOf("#1e3c72"), Color.RED);
ft.setCycleCount(2);
ft.setAutoReverse(true);
ft.play();
});
}
12
Source : ColorTransitionsDemo.java
with The Unlicense
from sgrinev
with The Unlicense
from sgrinev
@Override
public void start(Stage primaryStage) {
Shape circle = new Circle(50, 150, 50);
FillTransition ft = new FillTransition(Duration.seconds(3), circle, Color.RED, new Color(0, 0, 1, 0.5));
Scene scene = new Scene(new Pane(circle), 300, 250);
primaryStage.setScene(scene);
primaryStage.show();
ft.play();
}
4
Source : FillTransitionDemo.java
with MIT License
from HouariZegai
with MIT License
from HouariZegai
@Override
public void start(Stage primaryStage) {
Group group = new Group();
Rectangle rec = new Rectangle(100, 100, 150, 150);
FillTransition ft = new FillTransition(Duration.millis(1000), rec, Color.RED, Color.BLUE);
// Infinity Animation (Don't Stop)
ft.setCycleCount(FillTransition.INDEFINITE);
// Wait 2 Minutes and Play The Animation
ft.setDelay(Duration.seconds(1));
// Last Color (In this Example make Aqua & blue because is the 2 last Color)
ft.setFromValue(Color.AQUA);
ft.play();
group.getChildren().add(rec);
Scene scene = new Scene(group, 300, 250);
primaryStage.setreplacedle("Fill Transition !");
primaryStage.setScene(scene);
primaryStage.show();
}