// Path: projects/main/src/main/java/libshapedraw/animation/trident/Timeline.java
// public enum TimelineState {
//     IDLE(false), READY(false), PLAYING_FORWARD(true), PLAYING_REVERSE(true), SUSPENDED(
//             false), CANCELLED(false), DONE(false);
// 
//     private boolean isActive;
// 
//     private TimelineState(boolean isActive) {
//         this.isActive = isActive;
//     }
// }
// 
// Path: projects/main/src/main/java/libshapedraw/animation/trident/TimelineScenario.java
// public enum TimelineScenarioState {
//     DONE, PLAYING, IDLE, SUSPENDED
// }


import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import libshapedraw.animation.trident.Timeline.TimelineState;
import libshapedraw.animation.trident.TimelineScenario.TimelineScenarioState;
import libshapedraw.animation.trident.callback.RunOnUIThread;

                    if (timeline.durationFraction > 1.0f) {
                        timeline.durationFraction = 1.0f;
                        timeline.timelinePosition = 1.0f;
                        if (timeline.isLooping) {
                            boolean stopLoopingAnimation = timeline.toCancelAtCycleBreak;
                            int loopsToLive = timeline.repeatCount;
                            if (loopsToLive > 0) {
                                loopsToLive--;
                                stopLoopingAnimation = stopLoopingAnimation
                                        || (loopsToLive == 0);
                                timeline.repeatCount = loopsToLive;
                            }
                            if (stopLoopingAnimation) {
                                // end looping animation
                                hasEnded = true;
                                itTimeline.remove();
                            } else {
                                if (timeline.repeatBehavior == Timeline.RepeatBehavior.REVERSE) {
                                    timeline
                                    .replaceState(TimelineState.PLAYING_REVERSE);
                                    if (timeline.cycleDelay > 0) {
                                        timeline.pushState(TimelineState.READY);
                                        timeline.timeUntilPlay = timeline.cycleDelay;
                                    }
                                    this.callbackCallTimelineStateChanged(
                                            timeline,
                                            TimelineState.PLAYING_FORWARD);
                                } else {
                                    timeline.durationFraction = 0.0f;
                                    timeline.timelinePosition = 0.0f;

// Path: projects/main/src/main/java/libshapedraw/animation/trident/Timeline.java
// public enum TimelineState {
//     IDLE(false), READY(false), PLAYING_FORWARD(true), PLAYING_REVERSE(true), SUSPENDED(
//             false), CANCELLED(false), DONE(false);
// 
//     private boolean isActive;
// 
//     private TimelineState(boolean isActive) {
//         this.isActive = isActive;
//     }
// }
// 
// Path: projects/main/src/main/java/libshapedraw/animation/trident/TimelineScenario.java
// public enum TimelineScenarioState {
//     DONE, PLAYING, IDLE, SUSPENDED
// }


// Path: projects/main/src/main/java/libshapedraw/animation/trident/TimelineEngine.java
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import libshapedraw.animation.trident.Timeline.TimelineState;
import libshapedraw.animation.trident.TimelineScenario.TimelineScenarioState;
import libshapedraw.animation.trident.callback.RunOnUIThread;

                    if (timeline.durationFraction > 1.0f) {
                        timeline.durationFraction = 1.0f;
                        timeline.timelinePosition = 1.0f;
                        if (timeline.isLooping) {
                            boolean stopLoopingAnimation = timeline.toCancelAtCycleBreak;
                            int loopsToLive = timeline.repeatCount;
                            if (loopsToLive > 0) {
                                loopsToLive--;
                                stopLoopingAnimation = stopLoopingAnimation
                                        || (loopsToLive == 0);
                                timeline.repeatCount = loopsToLive;
                            }
                            if (stopLoopingAnimation) {
                                // end looping animation
                                hasEnded = true;
                                itTimeline.remove();
                            } else {
                                if (timeline.repeatBehavior == Timeline.RepeatBehavior.REVERSE) {
                                    timeline
                                    .replaceState(TimelineState.PLAYING_REVERSE);
                                    if (timeline.cycleDelay > 0) {
                                        timeline.pushState(TimelineState.READY);
                                        timeline.timeUntilPlay = timeline.cycleDelay;
                                    }
                                    this.callbackCallTimelineStateChanged(
                                            timeline,
                                            TimelineState.PLAYING_FORWARD);
                                } else {
                                    timeline.durationFraction = 0.0f;
                                    timeline.timelinePosition = 0.0f;

                                    if (timeline.cycleDelay > 0) {
