public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.translateXProperty(), (contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX()) * (leftDirection? -1 : 1), Interpolator.LINEAR), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT) ))); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.4)); setDelay(Duration.seconds(0)); } }
public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.translateYProperty(), (contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY()) * (topDirection? -1 : 1), Interpolator.LINEAR), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT) ))); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.4)); setDelay(Duration.seconds(0)); } }
public CenterTransition(Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR), new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT), new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH) ))); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.4)); setDelay(Duration.seconds(0)); } }
CheckBoxTransition(Node mark) { super(null, new Timeline( new KeyFrame( Duration.ZERO, new KeyValue(mark.opacityProperty(), 0, Interpolator.EASE_OUT), new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT) ), new KeyFrame(Duration.millis(400), new KeyValue(mark.opacityProperty(), 1, Interpolator.EASE_OUT), new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT) ), new KeyFrame( Duration.millis(1000), new KeyValue(mark.scaleXProperty(), 1, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 1, Interpolator.EASE_OUT) ) ) ); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.12)); setDelay(Duration.seconds(0.05)); this.mark = mark; }
new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), .getHeight() / 2), Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH)
)); frames.add(new KeyFrame(Duration.millis(duration.toMillis()), new KeyValue(container.getChildren().get(0).opacityProperty(), expanded ? 0 : 1, Interpolator.EASE_BOTH), new KeyValue(container.getChildren().get(0).translateXProperty(), expanded ? 20 : 0, Interpolator.EASE_BOTH) )); frames.add(new KeyFrame(Duration.millis(duration.toMillis() + 40), new KeyValue(container.getChildren().get(0).opacityProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH), new KeyValue(container.getChildren().get(0).translateXProperty(), expanded ? 0 : 20, Interpolator.EASE_BOTH) ));
new KeyFrame(Duration.millis(0), new KeyValue(getClip().scaleYProperty(), 1, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(0), new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(350), new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)), new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(370), new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(510), new KeyValue(getContentNode().opacityProperty(), 1, Interpolator.EASE_BOTH))); toggleAnimation.setOnFinished((finish) -> { if (toggleAnimation.getRate() == 1) {
new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).translateXProperty(), 0, Interpolator.EASE_BOTH) ), .getHeight() / 2), Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).translateXProperty(), -burger.getWidth() / 1.1,
opacities.add(/* dp */this.nodes.get(j).opacityProperty()); idx++;
animationPane.getChildren().add(node); }, new KeyValue(node.opacityProperty(), 0)); KeyFrame keyFrame2 = new KeyFrame(Duration.millis(startTimeMs), keyValueStartX, keyValueStartY); KeyFrame keyFrame3 = new KeyFrame(Duration.millis(startTimeMs + FADEDURATION), new KeyValue(node.opacityProperty(), 1)); KeyFrame keyFrame4 = new KeyFrame(Duration.millis(startTimeMs + FADEDURATION), keyValueStartX, keyValueStartY); KeyFrame keyFrame5 = new KeyFrame(Duration.millis(endTimeMs - FADEDURATION), keyValueEndX, keyValueEndY); KeyFrame keyFrame6 = new KeyFrame(Duration.millis(endTimeMs - FADEDURATION), new KeyValue(node.opacityProperty(), 1)); KeyFrame keyFrame7 = new KeyFrame(Duration.millis(endTimeMs), new EventHandler<ActionEvent>() { animationPane.getChildren().remove(node); }, new KeyValue(node.opacityProperty(), 0));
public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.translateYProperty(), (contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY()) * (topDirection? -1 : 1), Interpolator.LINEAR), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT) ))); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.4)); setDelay(Duration.seconds(0)); } }
public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.translateXProperty(), (contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX()) * (leftDirection? -1 : 1), Interpolator.LINEAR), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT) ))); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.4)); setDelay(Duration.seconds(0)); } }
public CenterTransition(Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR), new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT), new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH) ))); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.4)); setDelay(Duration.seconds(0)); } }
: new KeyFrame(Duration.ZERO, new KeyValue(cell.prefHeightProperty(), startHeight, Interpolator.EASE_BOTH), new KeyValue(graphic.opacityProperty(), 1.0, Interpolator.EASE_BOTH)); : new KeyFrame(Duration.millis(ANIMATION_DURATION / 2.0), replaceGraphicEvent, new KeyValue(graphic.opacityProperty(), 0.0, Interpolator.EASE_BOTH)); fireEvent2, new KeyValue(cell.prefHeightProperty(), endHeight, Interpolator.EASE_BOTH), new KeyValue(graphic.opacityProperty(), endOpacity, Interpolator.EASE_BOTH));
: new KeyFrame(Duration.ZERO, new KeyValue(cell.prefHeightProperty(), startHeight, Interpolator.EASE_BOTH), new KeyValue(graphic.opacityProperty(), 1.0, Interpolator.EASE_BOTH)); : new KeyFrame(Duration.millis(ANIMATION_DURATION / 2.0), replaceGraphicEvent, new KeyValue(graphic.opacityProperty(), 0.0, Interpolator.EASE_BOTH)); fireEvent2, new KeyValue(cell.prefHeightProperty(), endHeight, Interpolator.EASE_BOTH), new KeyValue(graphic.opacityProperty(), endOpacity, Interpolator.EASE_BOTH));
private void maybeAnimatePositionChange(final double position, final boolean showDetail) { Node detailNode = getSkinnable().getDetailNode(); if (detailNode == null) { return; } showDetailForTimeline.set(showDetail); Divider divider = splitPane.getDividers().get(0); if (showDetailForTimeline.get()) { unbindDividerPosition(); bindDividerPosition(); } if (getSkinnable().isAnimated() && detailNode != null) { KeyValue positionKeyValue = new KeyValue( divider.positionProperty(), position); KeyValue opacityKeyValue = new KeyValue(detailNode.opacityProperty(), showDetailForTimeline.get() ? 1 : 0); KeyFrame keyFrame = new KeyFrame(Duration.seconds(.1), "endAnimation", positionKeyValue, opacityKeyValue); timeline.getKeyFrames().clear(); timeline.getKeyFrames().add(keyFrame); timeline.playFromStart(); } else { detailNode.setOpacity(1); divider.setPosition(position); if (!showDetailForTimeline.get()) { unbindDividerPosition(); splitPane.getItems().remove(getSkinnable().getDetailNode()); } changing = false; } }
CheckBoxTransition(Node mark) { super(null, new Timeline( new KeyFrame( Duration.ZERO, new KeyValue(mark.opacityProperty(), 0, Interpolator.EASE_OUT), new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT) ), new KeyFrame(Duration.millis(400), new KeyValue(mark.opacityProperty(), 1, Interpolator.EASE_OUT), new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT) ), new KeyFrame( Duration.millis(1000), new KeyValue(mark.scaleXProperty(), 1, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 1, Interpolator.EASE_OUT) ) ) ); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.12)); setDelay(Duration.seconds(0.05)); this.mark = mark; }
new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), .getHeight() / 2), Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH)
new KeyFrame(Duration.millis(0), new KeyValue(getClip().scaleYProperty(), 1, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(0), new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(350), new KeyValue(getClip().scaleXProperty(), newRate, Interpolator.EASE_BOTH)), new KeyValue(getClip().scaleYProperty(), newRate, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(370), new KeyValue(getContentNode().opacityProperty(), 0, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(510), new KeyValue(getContentNode().opacityProperty(), 1, Interpolator.EASE_BOTH))); toggleAnimation.setOnFinished((finish) -> { if (toggleAnimation.getRate() == 1) {
new KeyValue(burger.getChildren().get(2).rotateProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(2).translateYProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).translateXProperty(), 0, Interpolator.EASE_BOTH) ), .getHeight() / 2), Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).opacityProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(burger.getChildren().get(1).translateXProperty(), -burger.getWidth() / 1.1,