// 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;

                                // + timeline.timelineKind.toString()
                                + " in state " + timeline.getState().name()
                                + " at position " + timeline.durationFraction);
                    }
                    TimelineState oldState = timeline.getState();
                    timeline.replaceState(TimelineState.DONE);
                    this.callbackCallTimelineStateChanged(timeline, oldState);
                    timeline.popState();
                    if (timeline.getState() != TimelineState.IDLE) {
                        throw new IllegalStateException(
                                "Timeline should be IDLE at this point");
                    }
                    this.callbackCallTimelineStateChanged(timeline,
                            TimelineState.DONE);
                } else {
                    if (DEBUG_MODE) {
                        System.out.println("Calling " + timeline.id + " on "
                                // + timeline.timelineKind.toString() + " at "
                                + timeline.durationFraction);
                    }
                    this.callbackCallTimelinePulse(timeline);
                }
            }

            if (this.runningScenarios.size() > 0) {
                // System.err.println(Thread.currentThread().getName()
                // + " : updating");
                for (Iterator<TimelineScenario> it = this.runningScenarios
                        .iterator(); it.hasNext();) {
                    TimelineScenario scenario = it.next();

// 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;

                                // + timeline.timelineKind.toString()
                                + " in state " + timeline.getState().name()
                                + " at position " + timeline.durationFraction);
                    }
                    TimelineState oldState = timeline.getState();
                    timeline.replaceState(TimelineState.DONE);
                    this.callbackCallTimelineStateChanged(timeline, oldState);
                    timeline.popState();
                    if (timeline.getState() != TimelineState.IDLE) {
                        throw new IllegalStateException(
                                "Timeline should be IDLE at this point");
                    }
                    this.callbackCallTimelineStateChanged(timeline,
                            TimelineState.DONE);
                } else {
                    if (DEBUG_MODE) {
                        System.out.println("Calling " + timeline.id + " on "
                                // + timeline.timelineKind.toString() + " at "
                                + timeline.durationFraction);
                    }
                    this.callbackCallTimelinePulse(timeline);
                }
            }

            if (this.runningScenarios.size() > 0) {
                // System.err.println(Thread.currentThread().getName()
                // + " : updating");
                for (Iterator<TimelineScenario> it = this.runningScenarios
                        .iterator(); it.hasNext();) {
                    TimelineScenario scenario = it.next();

                    if (scenario.state == TimelineScenarioState.DONE) {
