Search in sources :

Example 66 with Timeline

use of javafx.animation.Timeline in project JFoenix by jfoenixadmin.

the class JFXTreeCell method animateChild.

private void animateChild(int i, JFXTreeView<T> jfxTreeView) {
    Timeline createChildAnimation = createChildAnimation(this, i - jfxTreeView.animateRow - 1);
    if (jfxTreeView.childrenAnimationMap.containsKey(i)) {
        jfxTreeView.trans.getChildren().remove(jfxTreeView.childrenAnimationMap.get(i).getAnimation());
        jfxTreeView.childrenAnimationMap.get(i).getCell().clearCellAnimation();
    }
    jfxTreeView.childrenAnimationMap.put(i, new CellAnimation(this, createChildAnimation));
    jfxTreeView.trans.getChildren().add(createChildAnimation);
}
Also used : Timeline(javafx.animation.Timeline) CellAnimation(com.jfoenix.controls.JFXTreeView.CellAnimation)

Example 67 with Timeline

use of javafx.animation.Timeline in project JFoenix by jfoenixadmin.

the class JFXTreeCell method createSibAnimation.

private Timeline createSibAnimation(TreeCell<?> cell, int index) {
    cell.setTranslateY(((JFXTreeView<T>) getTreeView()).height);
    Timeline f2 = new Timeline(new KeyFrame(Duration.millis(120), new KeyValue(cell.translateYProperty(), 0, Interpolator.EASE_BOTH)));
    return f2;
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame)

Example 68 with Timeline

use of javafx.animation.Timeline in project JFoenix by jfoenixadmin.

the class JFXTreeCell method createChildAnimation.

private Timeline createChildAnimation(TreeCell<?> cell, int delay) {
    cell.setOpacity(0);
    cell.setTranslateY(-1);
    Timeline f1 = new Timeline(new KeyFrame(Duration.millis(120), new KeyValue(cell.opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(cell.translateYProperty(), 0, Interpolator.EASE_BOTH)));
    f1.setDelay(Duration.millis(20 + delay * 10));
    return f1;
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame)

Example 69 with Timeline

use of javafx.animation.Timeline in project JFoenix by jfoenixadmin.

the class JFXProgressBarSkin method createIndeterminateTimeline.

@Override
protected void createIndeterminateTimeline() {
    super.createIndeterminateTimeline();
    if (indeterminateTransition != null)
        indeterminateTransition.stop();
    ProgressIndicator control = getSkinnable();
    final double w = control.getWidth() - (snappedLeftInset() + snappedRightInset());
    final double bWidth = bar.getWidth();
    indeterminateTransition = new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(bar.scaleXProperty(), 0, Interpolator.EASE_IN), new KeyValue(bar.translateXProperty(), -bWidth, Interpolator.LINEAR)), new KeyFrame(Duration.seconds(0.5), new KeyValue(bar.scaleXProperty(), 3, Interpolator.LINEAR), new KeyValue(bar.translateXProperty(), w / 2, Interpolator.LINEAR)), new KeyFrame(Duration.seconds(1), new KeyValue(bar.scaleXProperty(), 0, Interpolator.EASE_OUT), new KeyValue(bar.translateXProperty(), w, Interpolator.LINEAR)));
    indeterminateTransition.setCycleCount(Timeline.INDEFINITE);
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) ProgressIndicator(javafx.scene.control.ProgressIndicator) KeyFrame(javafx.animation.KeyFrame)

Example 70 with Timeline

use of javafx.animation.Timeline in project JFoenix by jfoenixadmin.

the class JFXRadioButtonOldSkin method initializeComponents.

private void initializeComponents(final double x, final double y, final double w, final double h) {
    radio.setStroke(unSelectedColor);
    getSkinnable().selectedProperty().addListener((o, oldVal, newVal) -> {
        rippler.setRipplerFill(newVal ? unSelectedColor : selectedColor);
        timeline.setRate(newVal ? 1 : -1);
        timeline.play();
    });
    rippler.setRipplerFill(getSkinnable().isSelected() ? unSelectedColor : selectedColor);
    timeline = new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(dot.radiusProperty(), minRadius, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(200), new KeyValue(dot.radiusProperty(), radioRadius + radio.getStrokeWidth() / 2, Interpolator.EASE_BOTH)));
    rippler.setRipplerFill(getSkinnable().isSelected() ? unSelectedColor : selectedColor);
    timeline.setRate(getSkinnable().isSelected() ? 1 : -1);
    timeline.play();
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame)

Aggregations

Timeline (javafx.animation.Timeline)111 KeyFrame (javafx.animation.KeyFrame)107 KeyValue (javafx.animation.KeyValue)81 Duration (javafx.util.Duration)32 ActionEvent (javafx.event.ActionEvent)22 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 Pane (javafx.scene.layout.Pane)17 AnchorPane (javafx.scene.layout.AnchorPane)16 Level (java.util.logging.Level)15 Logger (java.util.logging.Logger)15 MouseEvent (javafx.scene.input.MouseEvent)14 Rotate (javafx.scene.transform.Rotate)14 JFXTextField (com.jfoenix.controls.JFXTextField)12 Interpolator (javafx.animation.Interpolator)12