use of javafx.animation.KeyFrame in project JFoenix by jfoenixadmin.
the class ProgressBarController method init.
@PostConstruct
public void init() throws FlowException, VetoException {
Timeline task = new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(progress1.progressProperty(), 0), new KeyValue(progress2.progressProperty(), 0)), new KeyFrame(Duration.seconds(2), new KeyValue(progress1.progressProperty(), 1), new KeyValue(progress2.progressProperty(), 1)));
task.setCycleCount(Timeline.INDEFINITE);
task.play();
}
use of javafx.animation.KeyFrame in project JFoenix by jfoenixadmin.
the class ProgressBarDemo method start.
@Override
public void start(Stage stage) throws Exception {
pane = new VBox();
pane.setSpacing(30);
pane.setStyle("-fx-background-color:WHITE");
ProgressBar bar = new ProgressBar();
bar.setPrefWidth(500);
ProgressBar cssBar = new ProgressBar();
cssBar.setPrefWidth(500);
cssBar.setProgress(-1.0f);
JFXProgressBar jfxBar = new JFXProgressBar();
jfxBar.setPrefWidth(500);
JFXProgressBar jfxBarInf = new JFXProgressBar();
jfxBarInf.setPrefWidth(500);
jfxBarInf.setProgress(-1.0f);
Timeline timeline = new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(bar.progressProperty(), 0), new KeyValue(jfxBar.progressProperty(), 0)), new KeyFrame(Duration.seconds(2), new KeyValue(bar.progressProperty(), 1), new KeyValue(jfxBar.progressProperty(), 1)));
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.play();
pane.getChildren().addAll(bar, jfxBar, cssBar, jfxBarInf);
StackPane main = new StackPane();
main.getChildren().add(pane);
main.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
StackPane.setMargin(pane, new Insets(20, 0, 0, 20));
final Scene scene = new Scene(main, 600, 200, Color.WHITE);
scene.getStylesheets().add(ProgressBarDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
stage.setTitle("JFX ProgressBar Demo ");
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
use of javafx.animation.KeyFrame in project cryptomator by cryptomator.
the class UnlockedController method startIoSampling.
// ****************************************
// IO Graph
// ****************************************
private void startIoSampling() {
final Series<Number, Number> decryptedBytes = new Series<>();
decryptedBytes.setName(localization.getString("unlocked.label.statsDecrypted"));
final Series<Number, Number> encryptedBytes = new Series<>();
encryptedBytes.setName(localization.getString("unlocked.label.statsEncrypted"));
ioGraph.getData().add(decryptedBytes);
ioGraph.getData().add(encryptedBytes);
ioAnimation = new Timeline();
ioAnimation.getKeyFrames().add(new KeyFrame(Duration.seconds(IO_SAMPLING_INTERVAL), new IoSamplingAnimationHandler(decryptedBytes, encryptedBytes)));
ioAnimation.setCycleCount(Animation.INDEFINITE);
ioAnimation.play();
}
use of javafx.animation.KeyFrame in project fxexperience2 by EricCanull.
the class FadeOutLeftBigTransition method starting.
@Override
protected void starting() {
double endX = -node.localToScene(0, 0).getX() - node.getBoundsInParent().getWidth();
timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateXProperty(), 0, WEB_EASE)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateXProperty(), endX, WEB_EASE)));
super.starting();
}
use of javafx.animation.KeyFrame in project fxexperience2 by EricCanull.
the class FadeOutUpBigTransition method starting.
@Override
protected void starting() {
double endY = -node.localToScene(0, 0).getY() - node.getBoundsInParent().getHeight();
timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateYProperty(), 0, WEB_EASE)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateYProperty(), endY, WEB_EASE)));
super.starting();
}
Aggregations