Search in sources :

Example 71 with KeyFrame

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();
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame) PostConstruct(javax.annotation.PostConstruct)

Example 72 with KeyFrame

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();
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) Insets(javafx.geometry.Insets) JFXProgressBar(com.jfoenix.controls.JFXProgressBar) KeyFrame(javafx.animation.KeyFrame) Scene(javafx.scene.Scene) JFXProgressBar(com.jfoenix.controls.JFXProgressBar) ProgressBar(javafx.scene.control.ProgressBar)

Example 73 with KeyFrame

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();
}
Also used : Series(javafx.scene.chart.XYChart.Series) Timeline(javafx.animation.Timeline) KeyFrame(javafx.animation.KeyFrame)

Example 74 with KeyFrame

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();
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame)

Example 75 with KeyFrame

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();
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame)

Aggregations

KeyFrame (javafx.animation.KeyFrame)108 Timeline (javafx.animation.Timeline)107 KeyValue (javafx.animation.KeyValue)82 Duration (javafx.util.Duration)32 ActionEvent (javafx.event.ActionEvent)21 JFXButton (com.jfoenix.controls.JFXButton)20 IOException (java.io.IOException)19 URL (java.net.URL)19 ResourceBundle (java.util.ResourceBundle)19 FXML (javafx.fxml.FXML)19 Initializable (javafx.fxml.Initializable)18 FXMLLoader (javafx.fxml.FXMLLoader)17 AnchorPane (javafx.scene.layout.AnchorPane)16 Pane (javafx.scene.layout.Pane)16 Level (java.util.logging.Level)15 Logger (java.util.logging.Logger)15 MouseEvent (javafx.scene.input.MouseEvent)13 Rotate (javafx.scene.transform.Rotate)13 JFXTextField (com.jfoenix.controls.JFXTextField)12 Interpolator (javafx.animation.Interpolator)12