Java Code Examples for javafx.animation.Interpolator#EASE_IN

The following examples show how to use javafx.animation.Interpolator#EASE_IN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Scene1Controller.java    From JavaFX-Tutorial-Codes with Apache License 2.0 7 votes vote down vote up
@FXML
private void loadSecond(ActionEvent event) throws IOException {
    Parent root = FXMLLoader.load(getClass().getResource("/javafx/scene/transition/scene2/scene2.fxml"));
    Scene scene = button.getScene();
    root.translateYProperty().set(scene.getHeight());

    parentContainer.getChildren().add(root);

    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(root.translateYProperty(), 0, Interpolator.EASE_IN);
    KeyFrame kf = new KeyFrame(Duration.seconds(1), kv);
    timeline.getKeyFrames().add(kf);
    timeline.setOnFinished(t -> {
        parentContainer.getChildren().remove(anchorRoot);
    });
    timeline.play();
}
 
Example 2
Source File: Scene2Controller.java    From JavaFX-Tutorial-Codes with Apache License 2.0 6 votes vote down vote up
@FXML
private void loadThird(ActionEvent event) throws IOException {
    Parent root = FXMLLoader.load(getClass().getResource("/javafx/scene/transition/scene3/scene3.fxml"));
    Scene scene = button.getScene();
    root.translateXProperty().set(scene.getWidth());

    StackPane parentContainer = (StackPane) button.getScene().getRoot();

    parentContainer.getChildren().add(root);

    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(root.translateXProperty(), 0, Interpolator.EASE_IN);
    KeyFrame kf = new KeyFrame(Duration.seconds(1), kv);
    timeline.getKeyFrames().add(kf);
    timeline.setOnFinished(t -> {
        parentContainer.getChildren().remove(container);
    });
    timeline.play();
}
 
Example 3
Source File: SplitFlapSkin.java    From Enzo with Apache License 2.0 6 votes vote down vote up
public void flipForward() {
    timeline.stop();
    flap.setCacheShape(true);
    flap.setCache(true);
    flap.setCacheHint(CacheHint.ROTATE);
    //flap.setCacheHint(CacheHint.SPEED);
    currentSelectionIndex++;
    if (currentSelectionIndex >= selectedSet.size()) {
        currentSelectionIndex = 0;
    }
    nextSelectionIndex = currentSelectionIndex + 1;
    if (nextSelectionIndex >= selectedSet.size()) {
        nextSelectionIndex = 0;
    }
    //keyValueFlap = new KeyValue(rotateFlap.angleProperty(), 180, Interpolator.SPLINE(0.5, 0.4, 0.4, 1.0));
    keyValueFlap = new KeyValue(rotateFlap.angleProperty(), 180, Interpolator.EASE_IN);
    keyFrame     = new KeyFrame(Duration.millis(getSkinnable().getFlipTime()), keyValueFlap);
    timeline.getKeyFrames().setAll(keyFrame);
    timeline.play();
}
 
Example 4
Source File: SplitFlapSkin.java    From Enzo with Apache License 2.0 5 votes vote down vote up
public void flipBackward() {
    timeline.stop();
    //keyValueFlap = new KeyValue(rotateFlap.angleProperty(), -180, Interpolator.SPLINE(0.5, 0.4, 0.4, 1.0));
    keyValueFlap = new KeyValue(rotateFlap.angleProperty(), -180, Interpolator.EASE_IN);
    keyFrame     = new KeyFrame(Duration.millis(getSkinnable().getFlipTime()), keyValueFlap);
    timeline.getKeyFrames().setAll(keyFrame);
    timeline.play();
}
 
Example 5
Source File: RadialMenu.java    From Enzo with Apache License 2.0 5 votes vote down vote up
private Timeline createItemOpenTimeLine(final StackPane NODE, final double X, final double Y, final double DELAY) {
    KeyValue kvX1  = new KeyValue(NODE.translateXProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvY1  = new KeyValue(NODE.translateYProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvR1  = new KeyValue(NODE.rotateProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvO1  = new KeyValue(NODE.opacityProperty(), 0.0, Interpolator.EASE_OUT);

    KeyValue kvX2  = new KeyValue(NODE.translateXProperty(), 0.0);
    KeyValue kvY2  = new KeyValue(NODE.translateYProperty(), 0.0);

    KeyValue kvX3  = new KeyValue(NODE.translateXProperty(), 1.1 * X, Interpolator.EASE_IN);
    KeyValue kvY3  = new KeyValue(NODE.translateYProperty(), 1.1 * Y, Interpolator.EASE_IN);

    KeyValue kvX4  = new KeyValue(NODE.translateXProperty(), 0.95 * X, Interpolator.EASE_OUT);
    KeyValue kvY4  = new KeyValue(NODE.translateYProperty(), 0.95 * Y, Interpolator.EASE_OUT);
    KeyValue kvRO4 = new KeyValue(NODE.rotateProperty(), 360);
    KeyValue kvO4  = new KeyValue(NODE.opacityProperty(), 1.0, Interpolator.EASE_OUT);

    KeyValue kvX5  = new KeyValue(NODE.translateXProperty(), X);
    KeyValue kvY5  = new KeyValue(NODE.translateYProperty(), Y);

    KeyFrame kfO1  = new KeyFrame(Duration.millis(0), kvX1, kvY1, kvR1, kvO1);
    KeyFrame kfO2  = new KeyFrame(Duration.millis(50 + DELAY), kvX2, kvY2);
    KeyFrame kfO3  = new KeyFrame(Duration.millis(250 + DELAY), kvX3, kvY3);
    KeyFrame kfO4  = new KeyFrame(Duration.millis(400 + DELAY), kvX4, kvY4, kvRO4, kvO4);
    KeyFrame kfO5  = new KeyFrame(Duration.millis(550 + DELAY), kvX5, kvY5);

    return new Timeline(kfO1, kfO2, kfO3, kfO4, kfO5);
}
 
Example 6
Source File: RadialMenu.java    From Enzo with Apache License 2.0 5 votes vote down vote up
private Timeline createItemCloseTimeLine(final StackPane NODE, final double X, final double Y, final double DELAY) {
    KeyValue kvX1  = new KeyValue(NODE.translateXProperty(), X);
    KeyValue kvY1  = new KeyValue(NODE.translateYProperty(), Y);

    KeyValue kvRC2 = new KeyValue(NODE.rotateProperty(), 720);

    KeyValue kvX3  = new KeyValue(NODE.translateXProperty(), X, Interpolator.EASE_IN);
    KeyValue kvY3  = new KeyValue(NODE.translateYProperty(), Y, Interpolator.EASE_IN);

    KeyValue kvX4  = new KeyValue(NODE.translateXProperty(), 0);
    KeyValue kvY4  = new KeyValue(NODE.translateYProperty(), 0);

    KeyValue kvX5  = new KeyValue(NODE.translateXProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvY5  = new KeyValue(NODE.translateYProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvR5  = new KeyValue(NODE.rotateProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvO5  = new KeyValue(NODE.opacityProperty(), 0.5);

    KeyValue kvO6  = new KeyValue(NODE.opacityProperty(), 0);

    KeyFrame kfC1  = new KeyFrame(Duration.millis(0), kvX1, kvY1);
    KeyFrame kfC2  = new KeyFrame(Duration.millis(50 + DELAY), kvRC2);
    KeyFrame kfC3  = new KeyFrame(Duration.millis(250 + DELAY), kvX3, kvY3);
    KeyFrame kfC4  = new KeyFrame(Duration.millis(400 + DELAY), kvX4, kvY4);
    KeyFrame kfC5  = new KeyFrame(Duration.millis(550 + DELAY), kvX5, kvY5, kvR5, kvO5);
    KeyFrame kfC6  = new KeyFrame(Duration.millis(551 + DELAY), kvO6);

    return new Timeline(kfC1, kfC2, kfC3, kfC4, kfC5, kfC6);
}
 
Example 7
Source File: RadialMenu.java    From Enzo with Apache License 2.0 5 votes vote down vote up
private Timeline createSimpleItemOpenTimeLine(final StackPane NODE, final double X, final double Y, final double DELAY) {
    KeyValue kvX1  = new KeyValue(NODE.translateXProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvY1  = new KeyValue(NODE.translateYProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvR1  = new KeyValue(NODE.rotateProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvO1  = new KeyValue(NODE.opacityProperty(), 0, Interpolator.EASE_OUT);

    KeyValue kvX2  = new KeyValue(NODE.translateXProperty(), 0.0);
    KeyValue kvY2  = new KeyValue(NODE.translateYProperty(), 0.0);

    KeyValue kvX3  = new KeyValue(NODE.translateXProperty(), 1.1 * X, Interpolator.EASE_IN);
    KeyValue kvY3  = new KeyValue(NODE.translateYProperty(), 1.1 * Y, Interpolator.EASE_IN);

    KeyValue kvX4  = new KeyValue(NODE.translateXProperty(), 0.97 * X, Interpolator.EASE_OUT);
    KeyValue kvY4  = new KeyValue(NODE.translateYProperty(), 0.97 * Y, Interpolator.EASE_OUT);
    KeyValue kvRO4 = new KeyValue(NODE.rotateProperty(), 360);
    KeyValue kvO4  = new KeyValue(NODE.opacityProperty(), 1.0, Interpolator.EASE_OUT);

    KeyValue kvX5  = new KeyValue(NODE.translateXProperty(), X);
    KeyValue kvY5  = new KeyValue(NODE.translateYProperty(), Y);

    KeyFrame kfO1  = new KeyFrame(Duration.millis(0), kvX1, kvY1, kvR1, kvO1);
    KeyFrame kfO2  = new KeyFrame(Duration.millis(50 + DELAY), kvX2, kvY2);
    KeyFrame kfO3  = new KeyFrame(Duration.millis(150 + DELAY), kvX3, kvY3);
    KeyFrame kfO4  = new KeyFrame(Duration.millis(300 + DELAY), kvX4, kvY4, kvRO4, kvO4);
    KeyFrame kfO5  = new KeyFrame(Duration.millis(400 + DELAY), kvX5, kvY5);

    return new Timeline(kfO1, kfO2, kfO3, kfO4, kfO5);
}
 
Example 8
Source File: RadialMenu.java    From Enzo with Apache License 2.0 5 votes vote down vote up
private Timeline createSimpleItemCloseTimeLine(final StackPane NODE, final double X, final double Y, final double DELAY) {
    KeyValue kvX1  = new KeyValue(NODE.translateXProperty(), X);
    KeyValue kvY1  = new KeyValue(NODE.translateYProperty(), Y);

    KeyValue kvRC2 = new KeyValue(NODE.rotateProperty(), 360);

    KeyValue kvX3  = new KeyValue(NODE.translateXProperty(), 1.0 * X, Interpolator.EASE_IN);
    KeyValue kvY3  = new KeyValue(NODE.translateYProperty(), 1.0 * Y, Interpolator.EASE_IN);

    KeyValue kvX4  = new KeyValue(NODE.translateXProperty(), 0.0);
    KeyValue kvY4  = new KeyValue(NODE.translateYProperty(), 0.0);

    KeyValue kvX5  = new KeyValue(NODE.translateXProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvY5  = new KeyValue(NODE.translateYProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvR5  = new KeyValue(NODE.rotateProperty(), 0, Interpolator.EASE_OUT);
    KeyValue kvO5  = new KeyValue(NODE.opacityProperty(), 0.5);

    KeyValue kvO6  = new KeyValue(NODE.opacityProperty(), 0);

    KeyFrame kfC1  = new KeyFrame(Duration.millis(0), kvX1, kvY1);
    KeyFrame kfC2  = new KeyFrame(Duration.millis(50 + DELAY), kvRC2);
    KeyFrame kfC3  = new KeyFrame(Duration.millis(250 + DELAY), kvX3, kvY3);
    KeyFrame kfC4  = new KeyFrame(Duration.millis(400 + DELAY), kvX4, kvY4);
    KeyFrame kfC5  = new KeyFrame(Duration.millis(550 + DELAY), kvX5, kvY5, kvR5, kvO5);
    KeyFrame kfC6  = new KeyFrame(Duration.millis(551 + DELAY), kvO6);

    return new Timeline(kfC1, kfC2, kfC3, kfC4, kfC5, kfC6);
}