/** * Defaults constructor that creates a container with a fade animation that last 320 ms. */ public ExtendedAnimatedFlowContainer() { this(Duration.millis(320)); }
public SnackbarEvent(Node content, PseudoClass pseudoClass) { this(content, Duration.millis(1500), pseudoClass); }
public SnackbarEvent(Node content) { this(content, Duration.millis(1500), null); }
public CurveTransition(Point2D from, Point2D to) { this.from = from; double fromDx = from.getX() - centerX; double fromDy = from.getY() - centerY; fromTheta = Math.atan2(fromDy, fromDx); double toDx = to.getX() - centerX; double toDy = to.getY() - centerY; toTheta = Math.atan2(toDy, toDx); setInterpolator(Interpolator.EASE_BOTH); setDelay(Duration.millis(0)); setCycleDuration(Duration.millis(240)); }
/** * init fxml when loaded. */ @PostConstruct public void init() { JFXDepthManager.setDepth(content, 1); JFXNodeUtils.addDelayedEventHandler(searchField, Duration.millis(400), KeyEvent.KEY_PRESSED, event -> highlighter.highlight(content, searchField.getText())); } }
private void createFillTransition() { select = new JFXFillTransition(Duration.millis(120), box, Color.TRANSPARENT, (Color) getSkinnable().getCheckedColor()); select.setInterpolator(Interpolator.EASE_OUT); }
/** * creates error animation frames when moving from small -> large error container * * @return */ private KeyFrame createScaleToOneFrames() { return new KeyFrame(Duration.millis(100), new KeyValue(errorClipScale.yProperty(), 1, Interpolator.EASE_BOTH)); }
/** * 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)); }
public void addAnimatedKeyValue(Node node, List<JFXDrawerKeyValue<?>> values) { Collection<JFXKeyValue<?>> modifiedValues = new ArrayList<>(); for (JFXDrawerKeyValue value : values) { JFXKeyValue modifiedValue = JFXKeyValue.builder() .setEndValueSupplier(() -> currentValue.get(value.getTarget()).get()) .setAnimateCondition(() -> node.getScene() != null && value.isValid()) .setTargetSupplier(() -> value.getTarget()) .setInterpolator(value.getInterpolator()).build(); modifiedValues.add(modifiedValue); currentValue.put(value.getTarget(), isClosed() ? value.getCloseValueSupplier() : value.getOpenValueSupplier()); initValues.put(value.getTarget(), value); } animatedValues.addAll(modifiedValues); final JFXKeyFrame keyFrame = new JFXKeyFrame(Duration.millis(450), modifiedValues.toArray(new JFXKeyValue[0])); try { translateTimer.addKeyFrame(keyFrame); } catch (Exception e) { e.printStackTrace(); } }
private void releaseRipple() { Ripple ripple = ripplesQueue.poll(); if(ripple!=null) { ripple.inAnimation.stop(); ripple.outAnimation = new Timeline( new KeyFrame(Duration.millis(Math.min(800, (0.9 * 500) / ripple.getScaleX())) , ripple.outKeyValues)); ripple.outAnimation.setOnFinished((event) -> getChildren().remove(ripple)); ripple.outAnimation.play(); if (generating.getAndSet(false)) { if (overlayRect != null) { overlayRect.inAnimation.stop(); if (!forceOverlay) overlayRect.outAnimation.play(); } } } }
@Override public Animation animateEntrance() { return new Timeline(new KeyFrame(Duration.millis(320), new KeyValue(nextPage.opacityProperty(), 1, EASE_BOTH))); }
public void togglePane() { if (toggleAnimation == null) { updateToggleAnimation(); } this.getClip().scaleXProperty().unbind(); this.getClip().scaleYProperty().unbind(); toggleAnimation.setRate(toggleAnimation.getRate() * -1); if (toggleAnimation.getCurrentTime().equals(Duration.millis(0)) && toggleAnimation.getRate() == -1) { toggleAnimation.playFrom(Duration.millis(510)); } else { toggleAnimation.play(); } }
public void refreshBadge() { badge.getChildren().clear(); if (enabled) { Label labelControl = new Label(text.getValue()); StackPane badgePane = new StackPane(); badgePane.getStyleClass().add("badge-pane"); badgePane.getChildren().add(labelControl); //Adding a clip would avoid overlap but this does not work as intended //badgePane.setClip(clip); badge.getChildren().add(badgePane); StackPane.setAlignment(badge, getPosition()); FadeTransition ft = new FadeTransition(Duration.millis(666), badge); ft.setFromValue(0); ft.setToValue(1.0); ft.setCycleCount(1); ft.setAutoReverse(true); ft.play(); } }
@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))); }
RightTransition() { super(contentHolder, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentHolder.translateXProperty(), offsetX, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.visibleProperty(), false, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(10), new KeyValue(JFXDialog.this.visibleProperty(), true, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(contentHolder.translateXProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.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)); } }
BottomTransition() { super(contentHolder, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentHolder.translateYProperty(), offsetY, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.visibleProperty(), false, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(10), new KeyValue(JFXDialog.this.visibleProperty(), true, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(contentHolder.translateYProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.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)); } }
TopTransition() { super(contentHolder, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentHolder.translateYProperty(), -offsetY, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.visibleProperty(), false, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(10), new KeyValue(JFXDialog.this.visibleProperty(), true, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(contentHolder.translateYProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(JFXDialog.this.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)); } }
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)); } }