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); }
@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(); }
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(); }
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(); }
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); }); }
@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(); }
/** * 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(); }
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(); }
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; }
@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(); }
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(); }
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; } }
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; } }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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); }
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(); }
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(); }
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(); }
/** * 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(); }
@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( ">" ); } }); }
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(); }
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(); }
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); }
@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(); }
@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(); }
@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(); }
@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(); }
@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(); }