Search in sources :

Example 11 with ParallelTransition

use of javafx.animation.ParallelTransition in project Board-Instrumentation-Framework by intel.

the class GaugeSkin method fadeBackToInteractive.

private void fadeBackToInteractive() {
    FadeTransition fadeUnitOut = new FadeTransition(Duration.millis(425), unitText);
    fadeUnitOut.setFromValue(1.0);
    fadeUnitOut.setToValue(0.0);
    FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), valueText);
    fadeValueOut.setFromValue(1.0);
    fadeValueOut.setToValue(0.0);
    PauseTransition pause = new PauseTransition(Duration.millis(50));
    FadeTransition fadeUnitIn = new FadeTransition(Duration.millis(425), unitText);
    fadeUnitIn.setFromValue(0.0);
    fadeUnitIn.setToValue(1.0);
    FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), valueText);
    fadeValueIn.setFromValue(0.0);
    fadeValueIn.setToValue(1.0);
    ParallelTransition parallelIn = new ParallelTransition(fadeUnitIn, fadeValueIn);
    ParallelTransition parallelOut = new ParallelTransition(fadeUnitOut, fadeValueOut);
    parallelOut.setOnFinished(event -> {
        unitText.setText("Interactive");
        valueText.setText("");
        resizeText();
    });
    SequentialTransition sequence = new SequentialTransition(parallelOut, pause, parallelIn);
    sequence.play();
}
Also used : SequentialTransition(javafx.animation.SequentialTransition) FadeTransition(javafx.animation.FadeTransition) PauseTransition(javafx.animation.PauseTransition) ParallelTransition(javafx.animation.ParallelTransition)

Aggregations

ParallelTransition (javafx.animation.ParallelTransition)11 KeyFrame (javafx.animation.KeyFrame)5 KeyValue (javafx.animation.KeyValue)5 SequentialTransition (javafx.animation.SequentialTransition)5 Timeline (javafx.animation.Timeline)5 FadeTransition (javafx.animation.FadeTransition)4 PauseTransition (javafx.animation.PauseTransition)4 Duration (javafx.util.Duration)4 ArrayList (java.util.ArrayList)3 Interpolator (javafx.animation.Interpolator)3 RotateTransition (javafx.animation.RotateTransition)3 HashMap (java.util.HashMap)2 List (java.util.List)2 FillTransition (javafx.animation.FillTransition)2 ScaleTransition (javafx.animation.ScaleTransition)2 Transition (javafx.animation.Transition)2 Group (javafx.scene.Group)2 Node (javafx.scene.Node)2 JFXAutoCompletePopup (com.jfoenix.controls.JFXAutoCompletePopup)1 JFXAutoCompleteEvent (com.jfoenix.controls.events.JFXAutoCompleteEvent)1