private void showTooltip() { if (activationTimer.getStatus() != Status.RUNNING) { activationTimer.stop(); activationTimer.playFromStart(); } }
timeline.setCycleCount(Timeline.INDEFINITE); timeline.setDelay(Duration.ZERO); timeline.playFromStart();
button.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { task.playFromStart();
reset.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { timeline.playFromStart();
timeline.playFromStart();
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(); } } } }); }
Timeline hideAfter1sec = new Timeline( new KeyFrame(Duration.seconds(1), sec->{ ((Label) selectedPane_1.Label.get(0)).setVisible(false); ((Label) selectedPane_2.Label.get(0)).setVisible(false); }) ); hideAfter1sec.playFromStart();
final MyFirstLineService svc = new MyFirstLineService(); final Duration oneFrameAmt = Duration.seconds(5); final KeyFrame oneFrame = new KeyFrame(oneFrameAmt, new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent evt) { svc.restart(); } }); Timeline timer = TimelineBuilder.create() .cycleCount(Animation.INDEFINITE) .keyFrames(oneFrame) .build(); timer.playFromStart();
@Override public void start(Stage primaryStage) { Circle circle = new Circle(10); circle.setManaged(false); Pane pane = new Pane(circle); circle.setCenterX(20); circle.setCenterY(800); Timeline timeline = new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(circle.centerXProperty(), 20), new KeyValue(circle.centerYProperty(), 800) ), new KeyFrame(Duration.seconds(3), new KeyValue(circle.centerXProperty(), 380), new KeyValue(circle.centerYProperty(), 10, new Interpolator() { @Override protected double curve(double t) { // parabola with zeros at t=0 and t=1 and a maximum of 1 at t=0.5 return 4 * t * (1 - t); } }) ) ); Scene scene = new Scene(pane, 400, 800); scene.setOnMouseClicked(evt -> timeline.playFromStart()); primaryStage.setScene(scene); primaryStage.show(); }
firing.playFromStart();
event.set(e); t.stop(); t.playFromStart(); }; EventHandler<MouseEvent> exitHandler = e -> {
event.set(e); t.stop(); t.playFromStart(); }; EventHandler<MouseEvent> exitHandler = e -> {
void restart() { timer.stop(); timer.playFromStart(); }
public void updateCaret(int index) { if (index != this.caretIndex) { if( this.scheduledAnimation != null ) { this.scheduledAnimation.stop(); } this.caretAnimation.stop(); if (index == -1) { hideCaret(); } else { showCaret(); this.caret.setOpacity(1); this.scheduledAnimation.playFromStart(); } this.caretIndex = index; requestLayout(); if (debugAnimation) { LineNode.this.debugUpdateCaret.play(); } } }
btn.setDisable(true); timerLabel.setVisible(true); timeline.playFromStart(); });
headeMessageTimeline.playFromStart();
this.positionUpdaterBottom.stop(); if( this.positionUpdaterTop.getStatus() != Status.RUNNING ) { this.positionUpdaterTop.playFromStart(); this.positionUpdaterTop.stop(); if( this.positionUpdaterBottom.getStatus() != Status.RUNNING ) { this.positionUpdaterBottom.playFromStart();
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; } }
@Override public void applyContentMatrix(IResponsiveAreaSize areasSize) { if(isLeftPaneOpen()) { leftPanewasclosedForResizing = true; } resizingTimeline.stop(); resizingTimeline.playFromStart(); final IResponsiveSizing leftSize = areasSize.getSizeOf(0); final IResponsiveSizing rightSize = areasSize.getSizeOf(1); minimized.set(leftSize.isToMinimize() || leftSize.isToHide()); if (orientation.get() == SwitchableTwoHPanesOrientation.LEFT) { //final boolean washidden = !leftFloatingPaneContentWrapper.isVisible(); IResponsiveAware.resize(leftFloatingPaneContentWrapper, leftSize); leftFloatingPaneContent.pseudoClassStateChanged(PseudoClass.getPseudoClass("minimized"), leftSize.isToMinimize() || leftSize.isToHide()); //if (washidden) { //leftFloatingPaneContentWrapper.setVisible(false); //} //closeLeftPaneImmediat(); } else { final boolean washidden = !rightFloatingPaneContentWrapper.isVisible(); IResponsiveAware.resize(rightFloatingPaneContentWrapper, leftSize); rightFloatingPaneContent.pseudoClassStateChanged(PseudoClass.getPseudoClass("minimized"), leftSize.isToMinimize() || leftSize.isToHide()); if (washidden) { rightFloatingPaneContentWrapper.setVisible(false); } closeRightPaneImmediat(); } IResponsiveAware.resize(centerScrollPaneWrapper, rightSize); updateSwitcherVisibility(); }
timeline.setCycleCount(Timeline.INDEFINITE); timeline.setDelay(Duration.ZERO); timeline.playFromStart();