/** * Defaults constructor that creates a container with a fade animation that last 320 ms. */ public ExtendedAnimatedFlowContainer() { this(Duration.millis(320)); }
/** * {@inheritDoc} */ @Override protected void interpolate(double d) { timeline.get().playFrom(Duration.seconds(d)); timeline.get().stop(); } }
AnimationHandler(Duration duration, Set<JFXKeyValue<?>> keyValues) { this.duration = duration.toMillis(); currentDuration = this.duration; this.keyValues = keyValues; }
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 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)); } }
new KeyValue(container.getChildren().get(1).scaleYProperty(), expanded ? 1 : 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)
private ErrorTooltipManager(String message) { require(isNotBlank(message), "Tooltip message cannot be blank"); this.tooltip = new Tooltip(message); this.tooltip.getStyleClass().add(ERROR_TOOLTIP_CLASS); hideTimer.getKeyFrames().add(new KeyFrame(new Duration(5000))); hideTimer.setOnFinished(e -> { tooltip.hide(); ErrorTooltipManager.this.active = false; }); activationTimer.getKeyFrames().add(new KeyFrame(new Duration(250))); activationTimer.setOnFinished(e -> { if (!ErrorTooltipManager.this.active) { Scene scene = getScene(); if (scene != null) { Window owner = scene.getWindow(); if (owner != null && owner.isShowing() && ValidableTextField.this.isVisible()) { Point2D where = getDisplayCoordiantes(owner, scene); tooltip.show(ValidableTextField.this, where.getX(), where.getY()); ErrorTooltipManager.this.active = true; hideTimer.playFromStart(); } } } }); }
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)); } }
), new KeyFrame( Duration.millis(10), e -> this.toFront(), new KeyValue(this.visibleProperty(), true, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(300), new KeyValue(this.opacityProperty(), 1, easeInterpolator), new KeyValue(this.translateYProperty(), 0, easeInterpolator) pauseTransition = Duration.INDEFINITE.equals(timeout) ? null : new PauseTransition(timeout); if (pauseTransition != null) { animation.setOnFinished(finish -> {
@Inject public ContentPane(WorkArea modules, Dashboard dashboard, NewsPanel news, @Named("defaultDashboardItemId") String defaultDasboardItem) { this.modules = modules; this.dashboard = dashboard; this.newsContainer = new VBox(news); this.newsContainer.getStyleClass().add("news-container"); StackPane stack = new StackPane(modules, dashboard); setHgrow(stack, Priority.ALWAYS); newsContainer.managedProperty().bind(newsContainer.visibleProperty()); newsContainer.setVisible(false); fadeIn = new FadeTransition(new Duration(300), newsContainer); fadeIn.setFromValue(0); fadeIn.setToValue(1); fadeOut = new FadeTransition(new Duration(300), newsContainer); fadeOut.setFromValue(1); fadeOut.setToValue(0); fadeOut.setOnFinished(e -> { newsContainer.setVisible(false); }); getChildren().addAll(stack, newsContainer); eventStudio().addAnnotatedListeners(this); eventStudio().broadcast(new SetActiveDashboardItemRequest(defaultDasboardItem)); }
public SnackbarEvent(Node content, PseudoClass pseudoClass) { this(content, Duration.millis(1500), pseudoClass); }
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)); } }
public HamburgerNextArrowBasicTransition(JFXHamburger burger) { super(burger, createTimeline(burger)); timeline.bind(Bindings.createObjectBinding(() -> createTimeline(burger), burger.widthProperty(), burger.heightProperty(), ((Region) burger.getChildren().get(0)).widthProperty(), ((Region) burger.getChildren().get(0)).heightProperty())); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.3)); setDelay(Duration.seconds(0)); }
AnimationHandler(Duration duration, Set<JFXKeyValue<?>> keyValues) { this.duration = duration.toMillis(); currentDuration = this.duration; this.keyValues = keyValues; }
/** * Like the usual {@code setProgress}-method but adds a smooth animation * * @param progress The progress to set */ public void setProgressAnimated(double progress) { Timeline timeline = new Timeline(); KeyValue keyValue = new KeyValue(this.progressProperty(), progress); KeyFrame keyFrame = new KeyFrame(new Duration(400), keyValue); timeline.getKeyFrames().add(keyFrame); timeline.play(); }
public SnackbarEvent(Node content) { this(content, Duration.millis(1500), null); }
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 HamburgerBackArrowBasicTransition(JFXHamburger burger) { super(burger, createTimeline(burger)); timeline.bind(Bindings.createObjectBinding(() -> createTimeline(burger), burger.widthProperty(), burger.heightProperty(), ((Region) burger.getChildren().get(0)).widthProperty(), ((Region) burger.getChildren().get(0)).heightProperty())); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.3)); setDelay(Duration.seconds(0)); }
private static EventStream<Boolean> booleanPulse(javafx.util.Duration javafxDuration, EventStream<?> restartImpulse) { Duration duration = Duration.ofMillis(Math.round(javafxDuration.toMillis())); EventStream<?> ticks = EventStreams.restartableTicks(duration, restartImpulse); return StateMachine.init(false) .on(restartImpulse.withDefaultEvent(null)).transition((state, impulse) -> true) .on(ticks).transition((state, tick) -> !state) .toStateStream(); }
/** * show the given notification * * @param title * @param text * @param milliSecs */ public static void showNotification(String title, String text, int milliSecs) { Notifications notification = Notifications.create(); notification.hideAfter(new Duration(milliSecs)); notification.title(title); notification.text(text); Platform.runLater(() -> notification.showInformation()); }