Example usage for javafx.animation FadeTransition FadeTransition

List of usage examples for javafx.animation FadeTransition FadeTransition

Introduction

In this page you can find the example usage for javafx.animation FadeTransition FadeTransition.

Prototype

public FadeTransition(Duration duration) 

Source Link

Document

The constructor of FadeTransition

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 260, 80);
    stage.setScene(scene);/*from   w  w  w  .j av a  2 s .  com*/

    VBox vb = new VBox();

    Rectangle rect = new Rectangle(100, 40, 100, 100);
    rect.setArcHeight(50);
    rect.setArcWidth(50);
    rect.setFill(Color.VIOLET);

    final Duration SEC_2 = Duration.millis(2000);
    final Duration SEC_3 = Duration.millis(3000);

    FadeTransition ft = new FadeTransition(SEC_3);
    ft.setFromValue(1.0f);
    ft.setToValue(0.3f);

    ft.setAutoReverse(true);
    TranslateTransition tt = new TranslateTransition(SEC_2);
    tt.setFromX(-100f);
    tt.setToX(100f);

    tt.setAutoReverse(true);
    RotateTransition rt = new RotateTransition(SEC_3);
    rt.setByAngle(180f);

    rt.setAutoReverse(true);
    ScaleTransition st = new ScaleTransition(SEC_2);
    st.setByX(1.5f);
    st.setByY(1.5f);

    st.setAutoReverse(true);

    ParallelTransition pt = new ParallelTransition(rect, ft, tt, rt, st);
    pt.play();
    vb.getChildren().add(rect);

    scene.setRoot(vb);
    stage.show();
}

From source file:net.rptools.tokentool.controller.TokenTool_Controller.java

private void treeViewFinish() {
    log.info("***treeViewFinish called");
    // Sort the nodes off of root
    treeItems = sortTreeNodes(treeItems);

    updateOverlayTreeview(treeItems);//from   w ww.  java 2  s . com
    addPseudoClassToLeafs(overlayTreeView);
    updateOverlayTreeViewRecentFolder(false);

    // overlayNameLabel.setVisible(true);
    overlayTreeProgressBar.setStyle("-fx-accent: forestgreen;");
    progressBarLabel.setVisible(false);

    FadeTransition fadeOut = new FadeTransition(Duration.millis(2000));
    fadeOut.setNode(overlayTreeProgressBar);
    fadeOut.setFromValue(1.0);
    fadeOut.setToValue(0.0);
    fadeOut.setCycleCount(1);
    fadeOut.setAutoReverse(false);
    fadeOut.playFromStart();

    FadeTransition fadeIn = new FadeTransition(Duration.millis(4000));
    fadeIn.setNode(overlayNameLabel);
    fadeIn.setFromValue(0.0);
    fadeIn.setToValue(1.0);
    fadeIn.setCycleCount(1);
    fadeIn.setAutoReverse(false);
    fadeIn.playFromStart();

}