AnimationHandler(Duration duration, Set<JFXKeyValue<?>> keyValues) { this.duration = duration.toMillis(); currentDuration = this.duration; this.keyValues = keyValues; }
/** * Defaults constructor that creates a container with a fade animation that last 320 ms. */ public ExtendedAnimatedFlowContainer() { this(Duration.millis(320)); }
public boolean isPersistent() { return Duration.INDEFINITE.equals(getTimeout()); } }
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(); } }
/** * {@inheritDoc} */ @Override protected void interpolate(double d) { timeline.get().playFrom(Duration.seconds(d)); timeline.get().stop(); } }
private void refreshSliderValueBinding() { sliderValue.textProperty().unbind(); if (((JFXSlider) getSkinnable()).getValueFactory() != null) { sliderValue.textProperty() .bind(((JFXSlider) getSkinnable()).getValueFactory().call((JFXSlider) getSkinnable())); } else { sliderValue.textProperty().bind(Bindings.createStringBinding(() -> { if (getSkinnable().getLabelFormatter() != null) { return getSkinnable().getLabelFormatter().toString(getSkinnable().getValue()); } else { return String.valueOf(Math.round(getSkinnable().getValue())); } }, getSkinnable().valueProperty())); } }
private DateCell createDayCell() { DateCell dayCell = null; // call cell factory if set by the user if (datePicker.getDayCellFactory() != null) { dayCell = datePicker.getDayCellFactory().call(datePicker); } // else create the defaul day cell if (dayCell == null) { dayCell = new DateCell(); } return dayCell; }
public SnackbarEvent(Node content, PseudoClass pseudoClass) { this(content, Duration.millis(1500), pseudoClass); }
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)); }
public final void setDuration(Duration value) { if ((duration != null) || (!DEFAULT_DURATION.equals(value))) { durationProperty().set(value); } }
public SnackbarEvent(Node content) { this(content, Duration.millis(1500), null); }
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 void playClickAnimation(double rate) { if (clickedAnimation != null) { if(!clickedAnimation.getCurrentTime().equals(clickedAnimation.getCycleDuration()) || rate != 1){ clickedAnimation.setRate(rate); clickedAnimation.play(); } } }
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)); }
public HamburgerBasicCloseTransition(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)); }
/** * 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())); } }
/** * 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)); }
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 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 Animation animateEntrance() { return new Timeline(new KeyFrame(Duration.millis(320), new KeyValue(nextPage.opacityProperty(), 1, EASE_BOTH))); }