Java 类javafx.animation.ParallelTransition 实例源码

项目:LCL    文件:Transition.java   
public static void lollipop(double x, double y) {
    Circle circle = new Circle(x, y, 2);
    circle.setFill(randomColor());
    FrameController.instance.hover.getChildren().add(circle);
    FadeTransition fadeTransition = new FadeTransition(Duration.millis(500), circle);
    fadeTransition.setAutoReverse(true);
    fadeTransition.setCycleCount(2);
    fadeTransition.setFromValue(0.0);
    fadeTransition.setToValue(1.0);
    ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(1000), circle);
    scaleTransition.setToX(10.0);
    scaleTransition.setToY(10.0);
    scaleTransition.setCycleCount(1);
    ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, scaleTransition);
    parallelTransition.play();
    executorService.schedule(() -> Platform.runLater(() ->
            FrameController.instance.hover.getChildren().remove(circle)), 1000, TimeUnit.MILLISECONDS);
}
项目:tilesfx    文件:HighLowTileSkin.java   
@Override protected void handleCurrentValue(final double VALUE) {
    double deviation = calculateDeviation(VALUE);
    updateState(deviation);
    valueText.setText(String.format(locale, formatString, VALUE));
    deviationText.setText(String.format(locale, "%." + tile.getTickLabelDecimals() + "f", deviation));

    RotateTransition rotateTransition = new RotateTransition(Duration.millis(200), triangle);
    rotateTransition.setFromAngle(triangle.getRotate());
    rotateTransition.setToAngle(state.angle);

    FillTransition fillIndicatorTransition = new FillTransition(Duration.millis(200), triangle);
    fillIndicatorTransition.setFromValue((Color) triangle.getFill());
    fillIndicatorTransition.setToValue(state.color);

    FillTransition fillReferenceTransition = new FillTransition(Duration.millis(200), deviationText);
    fillReferenceTransition.setFromValue((Color) triangle.getFill());
    fillReferenceTransition.setToValue(state.color);

    FillTransition fillReferenceUnitTransition = new FillTransition(Duration.millis(200), deviationUnitText);
    fillReferenceUnitTransition.setFromValue((Color) triangle.getFill());
    fillReferenceUnitTransition.setToValue(state.color);

    ParallelTransition parallelTransition = new ParallelTransition(rotateTransition, fillIndicatorTransition, fillReferenceTransition, fillReferenceUnitTransition);
    parallelTransition.play();
}
项目:programmierpraktikum-abschlussprojekt-amigos    文件:ExerciseController.java   
private void doOutputScaleAnimation(){
    ParallelTransition pt = new ParallelTransition();
    for(Node c : outputTabContainer.getChildren()){
        if(c == compilerArea) continue;
        ScaleTransition scale = new ScaleTransition(Duration.millis(250), c);
        scale.setFromX(1);
        scale.setToX(1.15);
        scale.setFromY(1);
        scale.setToY(1.15);
        scale.setAutoReverse(true);
        scale.setCycleCount(2);
        pt.getChildren().add(scale);
    }
    pt.play();

}
项目:cardnav    文件:CardBox.java   
public CardBox(final Card... CARDS) {
    super(CARDS);
    cards = FXCollections.observableArrayList();
    cards.addAll(CARDS);
    firstTime       = true;
    open            = new BooleanPropertyBase(false) {
        @Override protected void invalidated() { handleState(get()); }
        @Override public Object getBean() { return CardBox.this; }
        @Override public String getName() { return "open"; }
    };
    cardHandler     = e -> handleCardSelect((Card) e.getSource());
    selectedCard    = cards.size() == 0 ? null : cards.get(cards.size() - 1);
    openTransition  = new ParallelTransition();
    closeTransition = new SequentialTransition();
    initGraphics();
    registerListeners();
}
项目:FakeImageDetection    文件:LaunchScreeenController.java   
private void animate() {
    TranslateTransition tt = new TranslateTransition(Duration.millis(duration), load_image_button);
    TranslateTransition tLogo = new TranslateTransition(Duration.millis(duration), christopher);
    TranslateTransition tDesc = new TranslateTransition(Duration.millis(duration), description);

    ScaleTransition st = new ScaleTransition(Duration.millis(duration), load_image_button);
    st.setToX(3);
    st.setToY(3);

    tt.setByY(-180f);

    tLogo.setToY(50);
    tDesc.setToY(500);
    buttonParallelTransition = new ParallelTransition(load_image_button, st, tt, tLogo, tDesc);

    buttonParallelTransition.play();
    buttonParallelTransition.setOnFinished((e) -> {
        load_image_button.setOpacity(1);
    });
}
项目:slogo    文件:TurtleView.java   
@Override
public void update (Object object) {
    ITurtleState state = (ITurtleState) object;

    this.penStyleIndex = state.getPenStyle();
    TranslateTransition tt = new TranslateTransition(Duration.millis(mySpeed), this);

    double currentX = this.getTranslateX(); double currentY = this.getTranslateY();
    tt.setByX(currentX); tt.setByY(currentY); tt.setToX(state.getX()); tt.setToY(state.getY());

    RotateTransition rt = new RotateTransition(Duration.millis(mySpeed), this);

    double currentHeading = this.getRotate();
    rt.setByAngle(currentHeading); rt.setToAngle(state.getHeading());

    ParallelTransition pt = new ParallelTransition();
    pt.getChildren().addAll(tt, rt);

    pt.setOnFinished(e -> {
        updateTurtleState(state);
        System.out.println("myturtle: " + this.toString());
        tooltip.setText(this.toString());
    });

    pt.play();
}
项目:JCardGamesFX    文件:KlondikeMouseUtil.java   
/**
 * Animates card movements.
 *
 * @param card     The card view to animate.
 * @param sourceX  Source X coordinate of the card view.
 * @param sourceY  Source Y coordinate of the card view.
 * @param targetX  Destination X coordinate of the card view.
 * @param targetY  Destination Y coordinate of the card view.
 * @param duration The duration of the animation.
 * @param doAfter  The action to perform after the animation has been completed.
 */
private void animateCardMovement(
    CardView card, double sourceX, double sourceY,
    double targetX, double targetY, Duration duration,
    EventHandler<ActionEvent> doAfter) {

  Path path = new Path();
  path.getElements().add(new MoveToAbs(card, sourceX, sourceY));
  path.getElements().add(new LineToAbs(card, targetX, targetY));

  PathTransition pathTransition =
      new PathTransition(duration, path, card);
  pathTransition.setInterpolator(Interpolator.EASE_IN);
  pathTransition.setOnFinished(doAfter);

  Timeline blurReset = new Timeline();
  KeyValue bx = new KeyValue(card.getDropShadow().offsetXProperty(), 0, Interpolator.EASE_IN);
  KeyValue by = new KeyValue(card.getDropShadow().offsetYProperty(), 0, Interpolator.EASE_IN);
  KeyValue br = new KeyValue(card.getDropShadow().radiusProperty(), 2, Interpolator.EASE_IN);
  KeyFrame bKeyFrame = new KeyFrame(duration, bx, by, br);
  blurReset.getKeyFrames().add(bKeyFrame);

  ParallelTransition pt = new ParallelTransition(card, pathTransition, blurReset);
  pt.play();
}
项目:bco.bcozy    文件:LocationPane.java   
private void autoFocusPolygonAnimated(final LocationPolygon polygon) {
    final double xScale = (foregroundPane.getBoundingBox().getWidth() / polygon.prefWidth(0))
            * Constants.ZOOM_FIT_PERCENTAGE_WIDTH;
    final double yScale = (foregroundPane.getBoundingBox().getHeight() / polygon.prefHeight(0))
            * Constants.ZOOM_FIT_PERCENTAGE_HEIGHT;
    final double scale = (xScale < yScale) ? xScale : yScale;

    final ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(500));
    scaleTransition.setToX(scale);
    scaleTransition.setToY(scale);
    scaleTransition.setCycleCount(1);
    scaleTransition.setAutoReverse(true);

    final Point2D transition = calculateTransition(scale, polygon);

    final TranslateTransition translateTransition = new TranslateTransition(Duration.millis(500));
    translateTransition.setToX(transition.getX());
    translateTransition.setToY(transition.getY());
    translateTransition.setCycleCount(1);
    translateTransition.setAutoReverse(true);

    final ParallelTransition parallelTransition
            = new ParallelTransition(this, scaleTransition, translateTransition);
    parallelTransition.play();
}
项目:Tourney    文件:MaterialTextField.java   
private void initializePromptMoveTransition() {
    ScaleTransition promptScale = new ScaleTransition(promptAnimationDuration, this.promptLabel);
    promptScale.setFromX(1);
    promptScale.setFromY(1);
    promptScale.setToX(.7);
    promptScale.setToY(.7);
    promptScale.setInterpolator(promptAnimationInterpolator);

    TranslateTransition promptTranslate = new TranslateTransition(promptAnimationDuration, this.promptLabel);
    promptTranslate.setFromY(0);
    promptTranslate.setToY(-AnchorPane.getTopAnchor(this.promptLabel) - 4);
    promptTranslate.setInterpolator(promptAnimationInterpolator);

    this.promptLabel.translateXProperty().bind(
            this.promptLabel.widthProperty()
            .multiply(this.promptLabel.scaleXProperty()
                    .subtract(1)
                    .divide(2)));

    this.promptMoveAnimation = new ParallelTransition(promptScale, promptTranslate);

    this.promptUp = false;
}
项目:TweetwallFX    文件:CloudFadeOutStep.java   
@Override
public void doStep(final MachineContext context) {
    WordleSkin wordleSkin = (WordleSkin) context.get("WordleSkin");

    List<Transition> fadeOutTransitions = new ArrayList<>();

    Duration defaultDuration = Duration.seconds(1.5);

    // kill the remaining words from the cloud
    wordleSkin.word2TextMap.entrySet().forEach(entry -> {
        Text textNode = entry.getValue();
        FadeTransition ft = new FadeTransition(defaultDuration, textNode);
        ft.setToValue(0);
        ft.setOnFinished((event) -> {
            wordleSkin.getPane().getChildren().remove(textNode);
        });
        fadeOutTransitions.add(ft);
    });
    wordleSkin.word2TextMap.clear();

    ParallelTransition fadeLOuts = new ParallelTransition();

    fadeLOuts.getChildren().addAll(fadeOutTransitions);
    fadeLOuts.setOnFinished(e -> context.proceed());
    fadeLOuts.play();
}
项目:mephisto_iii    文件:WeatherForecastPanel.java   
public void setForecast(final Weather forecast) {
  final Image image = new Image(WeatherConditionMapper.getWeatherForecastIcon(forecast));

  ParallelTransition pt = new ParallelTransition(
      TransitionUtil.createOutFader(tempLabel),
      TransitionUtil.createOutFader(titleLabel),
      TransitionUtil.createOutFader(img)
  );
  pt.setOnFinished(new EventHandler<ActionEvent>() {
    @Override
    public void handle(ActionEvent actionEvent) {
      String day = forecastDayFormat.format(forecast.getForecastDate());
      titleLabel.setText(day);
      img.setImage(image);
      tempLabel.setText(forecast.getHighTemp() + "/" + forecast.getLowTemp() + " °C");

      ParallelTransition inFader = new ParallelTransition(
          TransitionUtil.createInFader(tempLabel),
          TransitionUtil.createInFader(titleLabel),
          TransitionUtil.createInFader(img)
      );
      inFader.play();
    }
  });
  pt.play();
}
项目:firstlight    文件:KnownWalletController.java   
private Animation createWalletHideAnimation() {
    try {
        FadeTransition fade = new FadeTransition(Duration.millis(1000), this.knownWalletDetailContainer);
        fade.setFromValue(1.0);
        fade.setToValue(0.0);
        fade.setCycleCount(1);

        ScaleTransition scale = new ScaleTransition(Duration.millis(1000), this.knownWalletDetailContainer);
        scale.setFromX(1.0);
        scale.setToX(0.1);
        scale.setFromY(1.0);
        scale.setToY(0.1);
        scale.setCycleCount(1);

        ParallelTransition parallel = new ParallelTransition();
        parallel.getChildren().addAll(fade, scale);
        parallel.setCycleCount(1);

        return parallel;        
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        return null;
    }       
}
项目:firstlight    文件:KnownWalletController.java   
private Animation createWalletShowAnimation() {
    try {
        FadeTransition fade = new FadeTransition(Duration.millis(1000), this.knownWalletDetailContainer);
        fade.setFromValue(0.0);
        fade.setToValue(1.0);
        fade.setCycleCount(1);

        ScaleTransition scale = new ScaleTransition(Duration.millis(1000), this.knownWalletDetailContainer);
        scale.setFromX(0.1);
        scale.setToX(1.0);
        scale.setFromY(0.1);
        scale.setToY(1.0);
        scale.setCycleCount(1);

        ParallelTransition parallel = new ParallelTransition();
        parallel.getChildren().addAll(fade, scale);
        parallel.setCycleCount(1);

        return parallel;        
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        return null;
    }       
}
项目:RadialFx    文件:Futurist.java   
private void animate() {
final Animation frame3Transition = new Timeline(new KeyFrame(
    Duration.ZERO,
        new KeyValue(frame3.rotateProperty(), 0)),
    new KeyFrame(Duration.millis(6700), new KeyValue(frame3.rotateProperty(), 360)));
frame3Transition.setCycleCount(Animation.INDEFINITE);

final Animation frame4Transition = new Timeline(new KeyFrame(
    Duration.ZERO,
        new KeyValue(frame4.rotateProperty(), 0)),
    new KeyFrame(Duration.millis(12000), new KeyValue(frame4.rotateProperty(), 360)));
frame4Transition.setCycleCount(Animation.INDEFINITE);

final Animation frame5Transition = new Timeline(new KeyFrame(
    Duration.ZERO,
        new KeyValue(frame5.rotateProperty(), 0)),
    new KeyFrame(Duration.millis(9000), new KeyValue(frame5.rotateProperty(), -360)));
frame5Transition.setCycleCount(Animation.INDEFINITE);


final ParallelTransition parallelTransition = new ParallelTransition(frame3Transition, frame4Transition, frame5Transition);
parallelTransition.play();
   }
项目:creacoinj    文件:MainController.java   
public void readyToGoAnimation() {
    // Buttons slide in and clickable address appears simultaneously.
    TranslateTransition arrive = new TranslateTransition(Duration.millis(1200), controlsBox);
    arrive.setInterpolator(new ElasticInterpolator(EasingMode.EASE_OUT, 1, 2));
    arrive.setToY(0.0);
    FadeTransition reveal = new FadeTransition(Duration.millis(1200), addressControl);
    reveal.setToValue(1.0);
    ParallelTransition group = new ParallelTransition(arrive, reveal);
    group.setDelay(NotificationBarPane.ANIM_OUT_DURATION);
    group.setCycleCount(1);
    group.play();
}
项目:ExtremeGuiMakeover    文件:AnimatedIcon.java   
public void toArrow() {
    stop();
    transition = new ParallelTransition();
    transition.getChildren().add(create(line1, 16, 6, 28, 16));
    transition.getChildren().add(create(line2, 4, 16, 24, 16));
    transition.getChildren().add(create(line3, 16, 26, 28, 16));

    transition.getChildren().add(createOpacityTransition(line1, 1));
    transition.getChildren().add(createOpacityTransition(line2, 1));
    transition.getChildren().add(createOpacityTransition(line3, 1));

    transition.getChildren().add(createRotationTransition(-180));
    transition.play();
}
项目:ExtremeGuiMakeover    文件:AnimatedIcon.java   
public void toMenu() {
    stop();
    transition = new ParallelTransition();
    transition.getChildren().add(create(line1, 4, 8, 28, 8));
    transition.getChildren().add(create(line2, 4, 16, 28, 16));
    transition.getChildren().add(create(line3, 4, 24, 28, 24));

    transition.getChildren().add(createOpacityTransition(line1, 1));
    transition.getChildren().add(createOpacityTransition(line2, 1));
    transition.getChildren().add(createOpacityTransition(line3, 1));

    transition.getChildren().add(createRotationTransition(0));
    transition.play();
}
项目:ExtremeGuiMakeover    文件:AnimatedIcon.java   
public void toBack() {
    stop();
    transition = new ParallelTransition();
    transition.getChildren().add(create(line1, 4, 16, 28, 4));
    transition.getChildren().add(create(line2, 4, 16, 28, 28));
    transition.getChildren().add(create(line3, 28, 4, 28, 28));

    transition.getChildren().add(createOpacityTransition(line1, 1));
    transition.getChildren().add(createOpacityTransition(line2, 1));
    transition.getChildren().add(createOpacityTransition(line3, 1));

    transition.getChildren().add(createRotationTransition(0));
    transition.play();
}
项目:ExtremeGuiMakeover    文件:AnimatedIcon.java   
public void toPlay() {
    stop();
    transition = new ParallelTransition();
    transition.getChildren().add(create(line1, 4, 16, 24, 4));
    transition.getChildren().add(create(line2, 4, 16, 24, 28));
    transition.getChildren().add(create(line3, 24, 4, 24, 28));

    transition.getChildren().add(createOpacityTransition(line1, 1));
    transition.getChildren().add(createOpacityTransition(line2, 1));
    transition.getChildren().add(createOpacityTransition(line3, 1));

    transition.getChildren().add(createRotationTransition(-180));
    transition.play();
}
项目:ExtremeGuiMakeover    文件:AnimatedIcon.java   
public void toClose() {
    stop();
    transition = new ParallelTransition();
    transition.getChildren().add(create(line1, 6, 6, 26, 26));
    transition.getChildren().add(create(line2, 4, 16, 28, 28));
    transition.getChildren().add(create(line3, 6, 26, 26, 6));

    transition.getChildren().add(createOpacityTransition(line1, 1));
    transition.getChildren().add(createOpacityTransition(line2, 0));
    transition.getChildren().add(createOpacityTransition(line3, 1));

    transition.getChildren().add(createRotationTransition(0));
    transition.play();
}
项目:ExtremeGuiMakeover    文件:AnimatedIcon.java   
public void toPlus() {
    stop();
    transition = new ParallelTransition();
    transition.getChildren().add(create(line1, 16, 6, 16, 26));
    transition.getChildren().add(create(line2, 4, 16, 28, 28));
    transition.getChildren().add(create(line3, 6, 16, 26, 16));

    transition.getChildren().add(createOpacityTransition(line1, 1));
    transition.getChildren().add(createOpacityTransition(line2, 0));
    transition.getChildren().add(createOpacityTransition(line3, 1));

    transition.getChildren().add(createRotationTransition(0));
    transition.play();
}
项目:ExtremeGuiMakeover    文件:AnimatedIcon.java   
public void toPause() {
    stop();
    transition = new ParallelTransition();
    transition.getChildren().add(create(line1, 12, 9, 12, 23));
    transition.getChildren().add(create(line2, 16, 9, 16, 23));
    transition.getChildren().add(create(line3, 20, 9, 20, 23));

    transition.getChildren().add(createOpacityTransition(line1, 1));
    transition.getChildren().add(createOpacityTransition(line2, 0));
    transition.getChildren().add(createOpacityTransition(line3, 1));

    transition.getChildren().add(createRotationTransition(0));
    transition.play();
}
项目:LCL    文件:ZoomTransition.java   
private static void zoom(Node node, double scaleFrom, double scaleTo, double opacity, EventHandler<ActionEvent> eventHandler) {
    ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(200), node);
    scaleTransition.setToX(scaleTo);
    scaleTransition.setToY(scaleTo);
    scaleTransition.setFromX(scaleFrom);
    scaleTransition.setFromY(scaleFrom);
    FadeTransition fadeTransition = new FadeTransition(Duration.millis(200), node);
    fadeTransition.setFromValue(opacity);
    fadeTransition.setToValue(1D - opacity);
    ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, scaleTransition);
    parallelTransition.play();
    parallelTransition.setOnFinished(eventHandler);
}
项目:LCL    文件:SliceTransition.java   
private static void slice(Node node, double layoutFromX, double layoutFromY, double layoutToX, double layoutToY,
                          double opacity, EventHandler<ActionEvent> handler) {
    FadeTransition fadeTransition = new FadeTransition(Duration.millis(200), node);
    fadeTransition.setFromValue(opacity);
    fadeTransition.setToValue(1D - opacity);
    Path path = new Path();
    path.getElements().add(new MoveTo(node.getLayoutX() + layoutToX, node.getLayoutY() + layoutToY));
    node.setLayoutX(node.getLayoutX() + layoutFromX);
    node.setLayoutY(node.getLayoutY() + layoutFromY);
    PathTransition pathTransition = new PathTransition(Duration.millis(200), path, node);
    ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, pathTransition);
    parallelTransition.setOnFinished(handler);
    parallelTransition.play();
}
项目:cryptwallet    文件:MainController.java   
public void readyToGoAnimation() {
    // Buttons slide in and clickable address appears simultaneously.
    TranslateTransition arrive = new TranslateTransition(Duration.millis(1200), controlsBox);
    arrive.setInterpolator(new ElasticInterpolator(EasingMode.EASE_OUT, 1, 2));
    arrive.setToY(0.0);
    FadeTransition reveal = new FadeTransition(Duration.millis(1200), addressControl);
    reveal.setToValue(1.0);
    ParallelTransition group = new ParallelTransition(arrive, reveal);
    group.setDelay(NotificationBarPane.ANIM_OUT_DURATION);
    group.setCycleCount(1);
    group.play();
}
项目:FakeImageDetection    文件:LaunchScreeenController.java   
private void removeBannersandDescs() {
    TranslateTransition tChristopher = new TranslateTransition(Duration.millis(duration), christopher);
    TranslateTransition tDescription = new TranslateTransition(Duration.millis(duration), description);
    tChristopher.setToY(-200);
    tDescription.setToY(1000);
    ParallelTransition pt = new ParallelTransition(tChristopher, tDescription);
    pt.play();

}
项目:FakeImageDetection    文件:NeuralnetInterfaceController.java   
private void removeBannersandDescs() {
    TranslateTransition tChristopher = new TranslateTransition(Duration.millis(1000), christopher);
    TranslateTransition tDescription = new TranslateTransition(Duration.millis(1000), description);
    tChristopher.setToY(-500);
    tDescription.setToY(-500);
    ParallelTransition pt = new ParallelTransition(tChristopher, tDescription);
    pt.play();

}
项目:mars-sim    文件:SlideDemo.java   
/**
 * Apply animation.
 *  
 * @param group Group to which animation is to be applied.
 */
private void applyAnimation(final Group group)
{
   final Path path = generateCurvyPath();
   group.getChildren().add(path);
   final Shape rmoug = generateTitleText();
   group.getChildren().add(rmoug);
   final Shape td = generateDaysText();
   group.getChildren().add(td);
   final Shape denver = generateLocationText();
   group.getChildren().add(denver);
   final PathTransition rmougTransition =
      generatePathTransition(
         rmoug, path, Duration.seconds(8.0), Duration.seconds(0.5),
         OrientationType.NONE);
   final PathTransition tdTransition =
      generatePathTransition(
         td, path, Duration.seconds(5.5), Duration.seconds(0.1),
         OrientationType.NONE);
   final PathTransition denverTransition =
      generatePathTransition(
         denver, path, Duration.seconds(30), Duration.seconds(3),
         OrientationType.ORTHOGONAL_TO_TANGENT);
   final ParallelTransition parallelTransition =
      new ParallelTransition(rmougTransition, tdTransition, denverTransition);
   parallelTransition.play(); 
}
项目:namecoinj    文件:MainController.java   
public void readyToGoAnimation() {
    // Buttons slide in and clickable address appears simultaneously.
    TranslateTransition arrive = new TranslateTransition(Duration.millis(1200), controlsBox);
    arrive.setInterpolator(new ElasticInterpolator(EasingMode.EASE_OUT, 1, 2));
    arrive.setToY(0.0);
    FadeTransition reveal = new FadeTransition(Duration.millis(1200), addressControl);
    reveal.setToValue(1.0);
    ParallelTransition group = new ParallelTransition(arrive, reveal);
    group.setDelay(NotificationBarPane.ANIM_OUT_DURATION);
    group.setCycleCount(1);
    group.play();
}
项目:examples-javafx-repos1    文件:BackgroundController.java   
@FXML
public void initialize() {

    TranslateTransition translateTransition =
            new TranslateTransition(Duration.millis(10000), background1);
    translateTransition.setFromX(0);
    translateTransition.setToX(-1 * BACKGROUND_WIDTH);
    translateTransition.setInterpolator(Interpolator.LINEAR);

    TranslateTransition translateTransition2 =
           new TranslateTransition(Duration.millis(10000), background2);
    translateTransition2.setFromX(0);
    translateTransition2.setToX(-1 * BACKGROUND_WIDTH);
    translateTransition2.setInterpolator(Interpolator.LINEAR);

    parallelTransition = 
        new ParallelTransition( translateTransition, translateTransition2 );
    parallelTransition.setCycleCount(Animation.INDEFINITE);

    //
    // Sets the label of the Button based on the animation state
    //
    parallelTransition.statusProperty().addListener((obs, oldValue, newValue) -> {
        if( newValue == Animation.Status.RUNNING ) {
            btnControl.setText( "||" );
        } else {
            btnControl.setText( ">" );
        }
    });
}
项目:FXImgurUploader    文件:HeatControlSkin.java   
private void fadeBack() {
    FadeTransition fadeInfoTextOut = new FadeTransition(Duration.millis(425), infoText);
    fadeInfoTextOut.setFromValue(1.0);
    fadeInfoTextOut.setToValue(0.0);

    FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), value);
    fadeValueOut.setFromValue(1.0);
    fadeValueOut.setToValue(0.0);

    PauseTransition pause = new PauseTransition(Duration.millis(50));

    FadeTransition fadeInfoTextIn = new FadeTransition(Duration.millis(425), infoText);
    fadeInfoTextIn.setFromValue(0.0);
    fadeInfoTextIn.setToValue(1.0);

    FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
    fadeValueIn.setFromValue(0.0);
    fadeValueIn.setToValue(1.0);                

    ParallelTransition parallelIn = new ParallelTransition(fadeInfoTextIn, fadeValueIn);

    ParallelTransition parallelOut = new ParallelTransition(fadeInfoTextOut, fadeValueOut);
    parallelOut.setOnFinished(event -> {
        double currentValue = (valueIndicatorRotate.getAngle() + getSkinnable().getStartAngle() - 180) / angleStep + getSkinnable().getMinValue();
        value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", currentValue));
        value.setTranslateX((size - value.getLayoutBounds().getWidth()) * 0.5);
        if (getSkinnable().getTarget() < getSkinnable().getValue()) {
            getSkinnable().setInfoText("COOLING");
        } else if (getSkinnable().getTarget() > getSkinnable().getValue()) {
            getSkinnable().setInfoText("HEATING");
        }

        resizeText();
        drawTickMarks(ticks);
        userAction = false;
    });

    SequentialTransition sequence = new SequentialTransition(parallelOut, pause, parallelIn);
    sequence.play();
}
项目:FXImgurUploader    文件:RadialBargraphSkin.java   
private void fadeBackToInteractive() {
    FadeTransition fadeUnitOut = new FadeTransition(Duration.millis(425), unit);
    fadeUnitOut.setFromValue(1.0);
    fadeUnitOut.setToValue(0.0);
    FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), value);
    fadeValueOut.setFromValue(1.0);
    fadeValueOut.setToValue(0.0);

    PauseTransition pause = new PauseTransition(Duration.millis(50));

    FadeTransition fadeUnitIn = new FadeTransition(Duration.millis(425), unit);
    fadeUnitIn.setFromValue(0.0);
    fadeUnitIn.setToValue(1.0);
    FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
    fadeValueIn.setFromValue(0.0);
    fadeValueIn.setToValue(1.0);
    ParallelTransition parallelIn = new ParallelTransition(fadeUnitIn, fadeValueIn);

    ParallelTransition parallelOut = new ParallelTransition(fadeUnitOut, fadeValueOut);
    parallelOut.setOnFinished(event -> {
        unit.setText("Interactive");
        value.setText("");
        resizeText();
    });

    SequentialTransition sequence = new SequentialTransition(parallelOut, pause, parallelIn);
    sequence.play();
}
项目:FXImgurUploader    文件:GaugeSkin.java   
private void fadeBackToInteractive() {
    FadeTransition fadeUnitOut = new FadeTransition(Duration.millis(425), unit);
    fadeUnitOut.setFromValue(1.0);
    fadeUnitOut.setToValue(0.0);
    FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), value);
    fadeValueOut.setFromValue(1.0);
    fadeValueOut.setToValue(0.0);

    PauseTransition pause = new PauseTransition(Duration.millis(50));

    FadeTransition fadeUnitIn = new FadeTransition(Duration.millis(425), unit);
    fadeUnitIn.setFromValue(0.0);
    fadeUnitIn.setToValue(1.0);
    FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
    fadeValueIn.setFromValue(0.0);
    fadeValueIn.setToValue(1.0);
    ParallelTransition parallelIn = new ParallelTransition(fadeUnitIn, fadeValueIn);

    ParallelTransition parallelOut = new ParallelTransition(fadeUnitOut, fadeValueOut);
    parallelOut.setOnFinished(event -> {
        unit.setText("Interactive");
        value.setText("");
        resizeText();
    });

    SequentialTransition sequence = new SequentialTransition(parallelOut, pause, parallelIn);
    sequence.play();
}
项目:CoinJoin    文件:MainController.java   
public void readyToGoAnimation() {
    // Buttons slide in and clickable address appears simultaneously.
    TranslateTransition arrive = new TranslateTransition(Duration.millis(1200), controlsBox);
    arrive.setInterpolator(new ElasticInterpolator(EasingMode.EASE_OUT, 1, 2));
    arrive.setToY(0.0);
    FadeTransition reveal = new FadeTransition(Duration.millis(1200), addressControl);
    reveal.setToValue(1.0);
    ParallelTransition group = new ParallelTransition(arrive, reveal);
    group.setDelay(NotificationBarPane.ANIM_OUT_DURATION);
    group.setCycleCount(1);
    group.play();
}
项目:Tourney    文件:MaterialTextField.java   
private void initializeUnderlineAnimation() {
    ScaleTransition scaleX = new ScaleTransition(underlineAnimationDuration, this.activeUnderline);
    scaleX.setFromX(0);
    scaleX.setToX(1);
    scaleX.setInterpolator(underlineAnimationInterpolator);
    FadeTransition fade = new FadeTransition(underlineAnimationDuration, this.activeUnderline);
    fade.setFromValue(0);
    fade.setToValue(1);
    this.underlineAnimation = new ParallelTransition(scaleX, fade);
}
项目:TweetwallFX    文件:Devoxx17ShowSchedule.java   
@Override
public void doStep(final MachineContext context) {
    WordleSkin wordleSkin = (WordleSkin) context.get("WordleSkin");
    final ScheduleDataProvider dataProvider = context.getDataProvider(ScheduleDataProvider.class);

    List<FlipInXTransition> transitions = new ArrayList<>();
    if (null == wordleSkin.getNode().lookup("#scheduleNode")) {
        try {
            BorderPane scheduleNode = FXMLLoader.<BorderPane>load(this.getClass().getResource("/schedule.fxml"));
            transitions.add(new FlipInXTransition(scheduleNode));
            scheduleNode.layoutXProperty().bind(Bindings.multiply(0.5, Bindings.subtract(wordleSkin.getSkinnable().widthProperty(), scheduleNode.widthProperty())));
            scheduleNode.layoutYProperty().bind(Bindings.multiply(0.2, Bindings.subtract(wordleSkin.getSkinnable().heightProperty(), scheduleNode.heightProperty())));
            wordleSkin.getPane().getChildren().add(scheduleNode);

            GridPane grid = (GridPane) scheduleNode.lookup("#sessionGrid");
            int col = 0;
            int row = 0;

            Iterator<SessionData> iterator = dataProvider.getFilteredSessionData().iterator();
            while (iterator.hasNext()) {
                Node node = createSessionNode(iterator.next());
                grid.getChildren().add(node);
                GridPane.setColumnIndex(node, col);
                GridPane.setRowIndex(node, row);
                col = (col == 0) ? 1 : 0;
                if (col == 0) {
                    row++;
                }
            }
        } catch (IOException ex) {
            LOGGER.error(ex);
        }
    }
    ParallelTransition flipIns = new ParallelTransition();
    flipIns.getChildren().addAll(transitions);
    flipIns.setOnFinished(e -> context.proceed());

    flipIns.play();
}
项目:TweetwallFX    文件:Devoxx17ShowSchedule.java   
@Override
public void doStep(final MachineContext context) {
    WordleSkin wordleSkin = (WordleSkin) context.get("WordleSkin");
    final ScheduleDataProvider dataProvider = context.getDataProvider(ScheduleDataProvider.class);

    List<FlipInXTransition> transitions = new ArrayList<>();
    if (null == wordleSkin.getNode().lookup("#scheduleNode")) {
        try {
            Node scheduleNode = FXMLLoader.<Node>load(this.getClass().getResource("/schedule.fxml"));
            transitions.add(new FlipInXTransition(scheduleNode));
            scheduleNode.layoutXProperty().bind(Bindings.multiply(150.0 / 1920.0, wordleSkin.getSkinnable().widthProperty()));
            scheduleNode.layoutYProperty().bind(Bindings.multiply(200.0 / 1280.0, wordleSkin.getSkinnable().heightProperty()));
            wordleSkin.getPane().getChildren().add(scheduleNode);

            GridPane grid = (GridPane) scheduleNode.lookup("#sessionGrid");
            int col = 0;
            int row = 0;

            Iterator<SessionData> iterator = dataProvider.getFilteredSessionData().iterator();
            while (iterator.hasNext()) {
                Node node = createSessionNode(iterator.next());
                grid.getChildren().add(node);
                GridPane.setColumnIndex(node, col);
                GridPane.setRowIndex(node, row);
                col = (col == 0) ? 1 : 0;
                if (col == 0) {
                    row++;
                }
            }
        } catch (IOException ex) {
            LOGGER.error(ex);
        }
    }
    ParallelTransition flipIns = new ParallelTransition();
    flipIns.getChildren().addAll(transitions);
    flipIns.setOnFinished(e -> context.proceed());

    flipIns.play();
}
项目:TweetwallFX    文件:Devoxx17ShowTopRatedToday.java   
@Override
public void doStep(final MachineContext context) {
    WordleSkin wordleSkin = (WordleSkin) context.get("WordleSkin");
    final TopTalksTodayDataProvider dataProvider = context.getDataProvider(TopTalksTodayDataProvider.class);

    List<FlipInXTransition> transitions = new ArrayList<>();
    if (null == wordleSkin.getNode().lookup("#topRatedToday")) {
        try {
            Node scheduleNode = FXMLLoader.<Node>load(this.getClass().getResource("/topratedtalktoday.fxml"));
            transitions.add(new FlipInXTransition(scheduleNode));
            scheduleNode.layoutXProperty().bind(Bindings.multiply(150.0 / 1920.0, wordleSkin.getSkinnable().widthProperty()));
            scheduleNode.layoutYProperty().bind(Bindings.multiply(200.0 / 1280.0, wordleSkin.getSkinnable().heightProperty()));
            wordleSkin.getPane().getChildren().add(scheduleNode);

            GridPane grid = (GridPane) scheduleNode.lookup("#sessionGrid");
            int col = 0;
            int row = 0;

            Iterator<VotedTalk> iterator = dataProvider.getFilteredSessionData().iterator();
            while (iterator.hasNext()) {
                Node node = createTalkNode(iterator.next());
                grid.getChildren().add(node);
                GridPane.setColumnIndex(node, col);
                GridPane.setRowIndex(node, row);
                row += 1;
            }
        } catch (IOException ex) {
            LOGGER.error(ex);
        }
    }
    ParallelTransition flipIns = new ParallelTransition();
    flipIns.getChildren().addAll(transitions);
    flipIns.setOnFinished(e -> context.proceed());

    flipIns.play();
}
项目:TweetwallFX    文件:Devoxx17FlipOutTweets.java   
@Override
public void doStep(final MachineContext context) {
    WordleSkin wordleSkin = (WordleSkin) context.get("WordleSkin");
    VBox vbox = (VBox) wordleSkin.getNode().lookup("#tweetList");

    List<Transition> transitions = new ArrayList<>();
    vbox.getChildren().forEach(node -> transitions.add(new FlipOutXTransition(node)));
    Node imageNode = wordleSkin.getNode().lookup("#tweetImage");
    ParallelTransition flipOuts = new ParallelTransition();
    if (null != imageNode) {
        FadeTransition fadeTransition = new FadeTransition(Duration.seconds(2), imageNode);
        fadeTransition.setDelay(Duration.seconds(0.2));
        fadeTransition.fromValueProperty().setValue(1);
        fadeTransition.toValueProperty().setValue(0);
        flipOuts.getChildren().add(fadeTransition);
    }
    flipOuts.getChildren().addAll(transitions);
    flipOuts.setOnFinished(e -> {
        vbox.getChildren().removeAll();
        wordleSkin.getPane().getChildren().remove(vbox);
        if (null != imageNode) {
            wordleSkin.getPane().getChildren().remove(imageNode);
        }
        context.proceed();
    });
    flipOuts.play();
}
项目:TweetwallFX    文件:Devoxx17ShowTopRatedWeek.java   
@Override
public void doStep(final MachineContext context) {
    WordleSkin wordleSkin = (WordleSkin) context.get("WordleSkin");
    final TopTalksWeekDataProvider dataProvider = context.getDataProvider(TopTalksWeekDataProvider.class);

    List<FlipInXTransition> transitions = new ArrayList<>();
    if (null == wordleSkin.getNode().lookup("#topRatedWeek")) {
        try {
            Node scheduleNode = FXMLLoader.<Node>load(this.getClass().getResource("/topratedtalkweek.fxml"));
            transitions.add(new FlipInXTransition(scheduleNode));
            scheduleNode.layoutXProperty().bind(Bindings.multiply(150.0 / 1920.0, wordleSkin.getSkinnable().widthProperty()));
            scheduleNode.layoutYProperty().bind(Bindings.multiply(200.0 / 1280.0, wordleSkin.getSkinnable().heightProperty()));
            wordleSkin.getPane().getChildren().add(scheduleNode);

            GridPane grid = (GridPane) scheduleNode.lookup("#sessionGrid");
            int col = 0;
            int row = 0;

            Iterator<VotedTalk> iterator = dataProvider.getFilteredSessionData().iterator();
            while (iterator.hasNext()) {
                Node node = createTalkNode(iterator.next());
                grid.getChildren().add(node);
                GridPane.setColumnIndex(node, col);
                GridPane.setRowIndex(node, row);
                row += 1;
            }
        } catch (IOException ex) {
            LOGGER.error(ex);
        }
    }
    ParallelTransition flipIns = new ParallelTransition();
    flipIns.getChildren().addAll(transitions);
    flipIns.setOnFinished(e -> context.proceed());

    flipIns.play();
}