@Override public void dispose() { animation.stop(); animation = null; container = null; control = null; popupContent = null; root = null; }
@Override public Animation animateSharedNodes() { return new Timeline(); }
private void clearAnimation() { if (timeline != null) { timeline.stop(); timeline.getKeyFrames().clear(); timeline = null; } } }
private void clearAnimation() { indeterminateTransition.stop(); ((Timeline) indeterminateTransition).getKeyFrames().clear(); indeterminateTransition = null; }
private void playClickAnimation(double rate) { if (clickedAnimation != null) { if(!clickedAnimation.getCurrentTime().equals(clickedAnimation.getCycleDuration()) || rate != 1){ clickedAnimation.setRate(rate); clickedAnimation.play(); } } }
public void animate() { init(); Animation exitAnimation = animateExit(); Animation sharedAnimation = animateSharedNodes(); Animation entranceAnimation = animateEntrance(); exitAnimation.setOnFinished(finish -> sharedAnimation.play()); sharedAnimation.setOnFinished(finish -> entranceAnimation.play()); entranceAnimation.setOnFinished(finish -> end()); exitAnimation.play(); }
private boolean isAnimating() { return timeline != null && timeline.getStatus() == Animation.Status.RUNNING; }
/** * set a specified {@link HamburgerTransition} * * @param animation */ public void setAnimation(Transition animation) { this.animation = ((HamburgerTransition) animation).getAnimation(this); this.animation.setRate(-1); }
@Override public Animation animateExit() { final Integer endValue = 0; return new Timeline( new KeyFrame(Duration.millis(300), new KeyValue(main.opacityProperty(), endValue, EASE_BOTH)), new KeyFrame(Duration.millis(520), new KeyValue(colorPane1.translateXProperty(), endValue, EASE_BOTH), new KeyValue(colorPane1.translateYProperty(), endValue, EASE_BOTH)), new KeyFrame(Duration.millis(200), new KeyValue(colorPane1.scaleXProperty(), 1, EASE_BOTH), new KeyValue(colorPane1.scaleYProperty(), 1, EASE_BOTH)), new KeyFrame(Duration.millis(1000), new KeyValue(colorPane1.scaleXProperty(), 40, EASE_BOTH), new KeyValue(colorPane1.scaleYProperty(), 40, EASE_BOTH))); }
private BiFunction<Boolean, Duration, Collection<KeyFrame>> initDefaultAnimation(Node child) { return (expanded, duration) -> { ArrayList<KeyFrame> frames = new ArrayList<>(); frames.add(new KeyFrame(duration, event -> { child.setScaleX(expanded ? 1 : 0); child.setScaleY(expanded ? 1 : 0); }, new KeyValue(child.scaleXProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH), new KeyValue(child.scaleYProperty(), expanded ? 1 : 0, Interpolator.EASE_BOTH) )); return frames; }; }
private void clearAnimation() { if (timeline != null) { timeline.stop(); timeline.getKeyFrames().clear(); timeline = null; } }
public Animation getListAnimation(boolean expanded){ Timeline animation = new Timeline(); createAnimation(expanded, animation); return animation; }
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)); } }
/** * creates error animation frames when moving from large -> small error container * * @param errorContainerHeight * @return */ private KeyFrame createSmallerScaleFrame(double errorContainerHeight) { return new KeyFrame(Duration.millis(100), new KeyValue(errorClipScale.yProperty(), errorContainerHeight / getHeight(), Interpolator.EASE_BOTH)); }
@Override public void dispose() { this.control = null; if (showTransition != null) { showTransition.stop(); showTransition.getKeyFrames().clear(); showTransition = null; } } }