public static void hackTooltipStartTiming(Tooltip tooltip) { try { Field fieldBehavior = tooltip.getClass().getDeclaredField("BEHAVIOR"); fieldBehavior.setAccessible(true); Object objBehavior = fieldBehavior.get(tooltip); Field fieldTimer = objBehavior.getClass().getDeclaredField("activationTimer"); fieldTimer.setAccessible(true); Timeline objTimer = (Timeline) fieldTimer.get(objBehavior); objTimer.getKeyFrames().clear(); objTimer.getKeyFrames().add(new KeyFrame(new Duration(250))); } catch (Exception e) { e.printStackTrace(); } }
private void clearAnimation() { indeterminateTransition.stop(); ((Timeline) indeterminateTransition).getKeyFrames().clear(); indeterminateTransition = null; }
private void clearAnimation() { if (timeline != null) { timeline.stop(); timeline.getKeyFrames().clear(); timeline = null; } } }
private void clearAnimation() { if (timeline != null) { timeline.stop(); timeline.getKeyFrames().clear(); timeline = null; } }
@Override public void dispose() { this.control = null; if (showTransition != null) { showTransition.stop(); showTransition.getKeyFrames().clear(); showTransition = null; } } }
@Override public <U> void setViewContext(ViewContext<U> context) { updatePlaceholder(context.getRootNode()); if (animation != null) { animation.stop(); } animation = new Timeline(); animation.getKeyFrames().addAll(animationProducer.apply(this)); animation.getKeyFrames().add(new KeyFrame(duration, (e) -> clearPlaceholder())); animation.play(); }
/** * Animates the list to show/hide the nodes. */ public void animateList() { expanded = !expanded; if (animateTimeline.getStatus() == Status.RUNNING) { animateTimeline.stop(); } animateTimeline.getKeyFrames().clear(); createAnimation(expanded, animateTimeline); animateTimeline.play(); }
private void createAnimation(boolean expanded, Timeline animation) { final ObservableList<Node> children = getChildren(); double duration = 160 / (double) children.size(); // show child nodes if (expanded) { for (Node child : children) { child.setVisible(true); } } // add child nodes animation for (int i = 1; i < children.size(); i++) { Node child = children.get(i); Collection<KeyFrame> frames = animationsMap.get(child).apply(expanded, Duration.millis(i * duration)); animation.getKeyFrames().addAll(frames); } // add 1st element animation Collection<KeyFrame> frames = animationsMap.get(children.get(0)).apply(expanded, Duration.millis(160)); animation.getKeyFrames().addAll(frames); // hide child nodes to allow mouse events on the nodes behind them if (!expanded) { animation.setOnFinished((finish) -> { for (int i = 1; i < children.size(); i++) { children.get(i).setVisible(false); } }); } else { animation.setOnFinished(null); } }
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(3), (event) -> { for (int i = 0; i < derivatives.length; i++) { derivatives[i] *= frictions[i];
scaleLess1.getKeyFrames().setAll(createSmallerScaleFrame(errorContainerHeight)); scaleLess1.setOnFinished(event -> { updateErrorContainerSize(w, errorContainerHeight); updateErrorContainerSize(w, errorContainerHeight); scale1.getKeyFrames().setAll(createScaleToOneFrames()); if (errorLabel.isWrapText()) { scaleLess1.getKeyFrames().setAll(new KeyFrame(Duration.millis(100), new KeyValue(errorClipScale.yProperty(), 0, Interpolator.EASE_BOTH))); scaleLess1.setOnFinished(event -> {
timeline.getKeyFrames().clear();
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(); } } } }); }
KeyValue kv1 = new KeyValue(c.scaleXProperty(), 5); KeyValue kv2 = new KeyValue(c.scaleYProperty(), 5); KeyFrame kf1 = new KeyFrame(Duration.millis(1500), kv1,kv2); Timeline grow = new Timeline(); grow.getKeyFrames().add(kf1); KeyValue kv3 = new KeyValue(c.centerXProperty(), 200); KeyFrame kf2 = new KeyFrame(Duration.millis(5000), kv3); Timeline move = new Timeline(); move.getKeyFrames().add(kf2); SequentialTransition sequence = new SequentialTransition(grow, move); sequence.play();
pbStart.setProgress(0.3); Timeline timeline = new Timeline(); KeyValue keyValue = new KeyValue(pbStart.progressProperty(), 0.9); KeyFrame keyFrame = new KeyFrame(new Duration(1000), keyValue); timeline.getKeyFrames().add(keyFrame); timeline.play();
button.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { pane.setVisible(false); Timeline timeline = new Timeline(); timeline.getKeyFrames().add( new KeyFrame(Duration.millis(1000), new KeyValue(pane.visibleProperty(), true))); timeline.play(); } });
private void clearAnimation() { if (timeline != null) { timeline.stop(); timeline.getKeyFrames().clear(); timeline = null; } }
private void restartStopwatch(Button button) { Timeline timeline = new Timeline(); for (int i = 0; i <= 5; i++) { final int timeRemaining = 5 - i ; KeyFrame frame = new KeyFrame(Duration.seconds(i), e -> button.setText("Updated. Restarting in: " + timeRemaining + " Seconds...")); timeline.getKeyFrames().add(frame); } timeline.setOnFinished(e -> new UpdateChecker().restartApplication()); timeline.play(); }
/** * Animates the list to show/hide the nodes. */ public void animateList() { expanded = !expanded; if (animateTimeline.getStatus() == Status.RUNNING) { animateTimeline.stop(); } animateTimeline.getKeyFrames().clear(); createAnimation(expanded, animateTimeline); animateTimeline.play(); }
/** * 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 void show(boolean autohide) { if(canShow) { _prepareShow(autohide); dialogStage.getScene().getRoot().opacityProperty().set(0); dialogStage.show(); Timeline timeline = new Timeline(); KeyFrame key = new KeyFrame(Duration.millis(100), new KeyValue (dialogStage.getScene().getRoot().opacityProperty(), 1)); timeline.getKeyFrames().add(key); timeline.play(); canShow = false; } }