Java Code Examples for javafx.animation.Animation.Status#STOPPED

The following examples show how to use javafx.animation.Animation.Status#STOPPED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StopWatchSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public void startStop() {
    if (time.getStatus() != Status.STOPPED) {
        // if started, stop it
        time.stop();
        lastClockTime = 0;
    } else {
        // if stopped, restart
        time.play();
    }
}
 
Example 2
Source File: StopWatchSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public void stopReset() {
    if (time.getStatus() != Status.STOPPED) {
        // if started, stop it
        time.stop();
        lastClockTime = 0;
    } else {
        // if stopped, reset it
        lastClockTime = 0;
        elapsedMillis = 0;
        refreshTimeDisplay(0, 0, 0);
    }
}
 
Example 3
Source File: StopWatchSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public void startStop() {
    if (time.getStatus() != Status.STOPPED) {
        // if started, stop it
        time.stop();
        lastClockTime = 0;
    } else {
        // if stopped, restart
        time.play();
    }
}
 
Example 4
Source File: StopWatchSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public void stopReset() {
    if (time.getStatus() != Status.STOPPED) {
        // if started, stop it
        time.stop();
        lastClockTime = 0;
    } else {
        // if stopped, reset it
        lastClockTime = 0;
        elapsedMillis = 0;
        refreshTimeDisplay(0, 0, 0);
    }
}
 
Example 5
Source File: StopWatch.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void startStop() {
    if (time.getStatus() != Status.STOPPED) {
        // if started, stop it
        time.stop();
        lastClockTime = 0;
    } else {
        // if stopped, restart
        time.play();
    }
}
 
Example 6
Source File: StopWatch.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void stopReset() {
    if (time.getStatus() != Status.STOPPED) {
        // if started, stop it
        time.stop();
        lastClockTime = 0;
    } else {
        // if stopped, reset it
        lastClockTime = 0;
        elapsedMillis = 0;
        refreshTimeDisplay(0, 0, 0);
    }
}
 
Example 7
Source File: JFXDatePickerContent.java    From JFoenix with Apache License 2.0 5 votes vote down vote up
protected void forward(int offset, ChronoUnit unit, boolean focusDayCell, boolean withAnimation) {
    if (withAnimation) {
        if (tempImageTransition == null || tempImageTransition.getStatus() == Status.STOPPED) {
            Pane monthContent = (Pane) calendarPlaceHolder.getChildren().get(0);
            this.getParent().setManaged(false);
            SnapshotParameters snapShotparams = new SnapshotParameters();
            snapShotparams.setFill(Color.TRANSPARENT);
            WritableImage temp = monthContent.snapshot(snapShotparams,
                new WritableImage((int) monthContent.getWidth(),
                    (int) monthContent.getHeight()));
            ImageView tempImage = new ImageView(temp);
            calendarPlaceHolder.getChildren().add(calendarPlaceHolder.getChildren().size() - 2, tempImage);
            TranslateTransition imageTransition = new TranslateTransition(Duration.millis(160), tempImage);
            imageTransition.setToX(-offset * calendarPlaceHolder.getWidth());
            imageTransition.setOnFinished((finish) -> calendarPlaceHolder.getChildren().remove(tempImage));
            monthContent.setTranslateX(offset * calendarPlaceHolder.getWidth());
            TranslateTransition contentTransition = new TranslateTransition(Duration.millis(160), monthContent);
            contentTransition.setToX(0);

            tempImageTransition = new ParallelTransition(imageTransition, contentTransition);
            tempImageTransition.setOnFinished((finish) -> {
                calendarPlaceHolder.getChildren().remove(tempImage);
                this.getParent().setManaged(true);
            });
            tempImageTransition.play();
        }
    }
    YearMonth yearMonth = selectedYearMonth.get();
    DateCell dateCell = currentFocusedDayCell;
    if (dateCell == null || !(dayCellDate(dateCell).getMonth() == yearMonth.getMonth())) {
        dateCell = findDayCellOfDate(yearMonth.atDay(1));
    }
    goToDayCell(dateCell, offset, unit, focusDayCell);
}
 
Example 8
Source File: JFXPopupSkin.java    From JFoenix with Apache License 2.0 4 votes vote down vote up
public final void animate() {
    if (animation.getStatus() == Status.STOPPED) {
        animation.play();
    }
}