// Path: projects/main/src/main/java/libshapedraw/animation/trident/TimelineEngine.java
// class TridentAnimationThread extends Thread {
//     public TridentAnimationThread() {
//         super();
//         this.setName("Trident pulse source thread");
//         this.setDaemon(true);
//     }
// 
//     /*
//      * (non-Javadoc)
//      * 
//      * @see java.lang.Thread#run()
//      */
//     @Override
//     public final void run() {
//         TridentConfig.PulseSource pulseSource = TridentConfig.getInstance()
//                 .getPulseSource();
//         lastIterationTimeStamp = System.currentTimeMillis();
//         while (true) {
//             pulseSource.waitUntilNextPulse();
//             updateTimelines();
//             // engine.currLoopId++;
//         }
//     }
// 
//     @Override
//     public void interrupt() {
//         System.err.println("Interrupted");
//         super.interrupt();
//     }
// }
// 
// Path: projects/main/src/main/java/libshapedraw/animation/trident/interpolator/CorePropertyInterpolators.java
// public class CorePropertyInterpolators implements PropertyInterpolatorSource {
//     private Set<PropertyInterpolator> interpolators;
// 
//     public CorePropertyInterpolators() {
//         this.interpolators = new HashSet<PropertyInterpolator>();
//         this.interpolators.add(new IntegerPropertyInterpolator());
//         this.interpolators.add(new FloatPropertyInterpolator());
//         this.interpolators.add(new DoublePropertyInterpolator());
//         this.interpolators.add(new LongPropertyInterpolator());
//     }
// 
//     @Override
//     public Set<PropertyInterpolator> getPropertyInterpolators() {
//         return Collections.unmodifiableSet(this.interpolators);
//     }
// 
//     private static class FloatPropertyInterpolator implements
//     PropertyInterpolator<Float> {
//         @Override
//         public Class getBasePropertyClass() {
//             return Float.class;
//         }
// 
//         @Override
//         public Float interpolate(Float from, Float to, float timelinePosition) {
//             return from + (to - from) * timelinePosition;
//         }
//     }
// 
//     private static class DoublePropertyInterpolator implements
//     PropertyInterpolator<Double> {
//         @Override
//         public Class getBasePropertyClass() {
//             return Double.class;
//         }
// 
//         @Override
//         public Double interpolate(Double from, Double to, float timelinePosition) {
//             return from + (to - from) * timelinePosition;
//         }
//     }
// 
//     private static class IntegerPropertyInterpolator implements
//     PropertyInterpolator<Integer> {
//         @Override
//         public Class getBasePropertyClass() {
//             return Integer.class;
//         }
// 
//         @Override
//         public Integer interpolate(Integer from, Integer to,
//                 float timelinePosition) {
//             return (int) (from + (to - from) * timelinePosition);
//         }
//     }
// 
//     private static class LongPropertyInterpolator implements
//     PropertyInterpolator<Long> {
//         @Override
//         public Class getBasePropertyClass() {
//             return Long.class;
//         }
// 
//         @Override
//         public Long interpolate(Long from, Long to, float timelinePosition) {
//             return (long) (from + (to - from) * timelinePosition);
//         }
//     }
// }
// 
// Path: projects/main/src/main/java/libshapedraw/animation/trident/interpolator/PropertyInterpolator.java
// public interface PropertyInterpolator<T> {
//     public Class getBasePropertyClass();
// 
//     public T interpolate(T from, T to, float timelinePosition);
// }
// 
// Path: projects/main/src/main/java/libshapedraw/animation/trident/interpolator/PropertyInterpolatorSource.java
// public interface PropertyInterpolatorSource {
//     public Set<PropertyInterpolator> getPropertyInterpolators();
// }


import java.io.*;
import java.net.URL;
import java.util.*;
import libshapedraw.animation.trident.TimelineEngine.TridentAnimationThread;
import libshapedraw.animation.trident.interpolator.CorePropertyInterpolators;
import libshapedraw.animation.trident.interpolator.PropertyInterpolator;
import libshapedraw.animation.trident.interpolator.PropertyInterpolatorSource;


    public synchronized void addPropertyInterpolator(
            PropertyInterpolator pInterpolator) {
        this.propertyInterpolators.add(pInterpolator);
    }

    public synchronized void addPropertyInterpolatorSource(
            PropertyInterpolatorSource pInterpolatorSource) {
        this.propertyInterpolators.addAll(pInterpolatorSource
                .getPropertyInterpolators());
    }

    public synchronized void removePropertyInterpolator(
            PropertyInterpolator pInterpolator) {
        this.propertyInterpolators.remove(pInterpolator);
    }

    public synchronized void addUIToolkitHandler(
            UIToolkitHandler uiToolkitHandler) {
        this.uiToolkitHandlers.add(uiToolkitHandler);
    }

    public synchronized void removeUIToolkitHandler(
            UIToolkitHandler uiToolkitHandler) {
        this.uiToolkitHandlers.remove(uiToolkitHandler);
    }

    public synchronized void setPulseSource(PulseSource pulseSource) {
        TridentAnimationThread current = TimelineEngine.getInstance().animatorThread;
        if ((current != null) && current.isAlive())

// Path: projects/main/src/main/java/libshapedraw/animation/trident/TimelineEngine.java
// class TridentAnimationThread extends Thread {
//     public TridentAnimationThread() {
//         super();
//         this.setName("Trident pulse source thread");
//         this.setDaemon(true);
//     }
// 
//     /*
//      * (non-Javadoc)
//      * 
//      * @see java.lang.Thread#run()
//      */
//     @Override
//     public final void run() {
//         TridentConfig.PulseSource pulseSource = TridentConfig.getInstance()
//                 .getPulseSource();
//         lastIterationTimeStamp = System.currentTimeMillis();
//         while (true) {
//             pulseSource.waitUntilNextPulse();
//             updateTimelines();
//             // engine.currLoopId++;
//         }
//     }
// 
//     @Override
//     public void interrupt() {
//         System.err.println("Interrupted");
//         super.interrupt();
//     }
// }
// 
// Path: projects/main/src/main/java/libshapedraw/animation/trident/interpolator/CorePropertyInterpolators.java
// public class CorePropertyInterpolators implements PropertyInterpolatorSource {
//     private Set<PropertyInterpolator> interpolators;
// 
//     public CorePropertyInterpolators() {
//         this.interpolators = new HashSet<PropertyInterpolator>();
//         this.interpolators.add(new IntegerPropertyInterpolator());
//         this.interpolators.add(new FloatPropertyInterpolator());
//         this.interpolators.add(new DoublePropertyInterpolator());
//         this.interpolators.add(new LongPropertyInterpolator());
//     }
// 
//     @Override
//     public Set<PropertyInterpolator> getPropertyInterpolators() {
//         return Collections.unmodifiableSet(this.interpolators);
//     }
// 
//     private static class FloatPropertyInterpolator implements
//     PropertyInterpolator<Float> {
//         @Override
//         public Class getBasePropertyClass() {
//             return Float.class;
//         }
// 
//         @Override
//         public Float interpolate(Float from, Float to, float timelinePosition) {
//             return from + (to - from) * timelinePosition;
//         }
//     }
// 
//     private static class DoublePropertyInterpolator implements
//     PropertyInterpolator<Double> {
//         @Override
//         public Class getBasePropertyClass() {
//             return Double.class;
//         }
// 
//         @Override
//         public Double interpolate(Double from, Double to, float timelinePosition) {
//             return from + (to - from) * timelinePosition;
//         }
//     }
// 
//     private static class IntegerPropertyInterpolator implements
//     PropertyInterpolator<Integer> {
//         @Override
//         public Class getBasePropertyClass() {
//             return Integer.class;
//         }
// 
//         @Override
//         public Integer interpolate(Integer from, Integer to,
//                 float timelinePosition) {
//             return (int) (from + (to - from) * timelinePosition);
//         }
//     }
// 
//     private static class LongPropertyInterpolator implements
//     PropertyInterpolator<Long> {
//         @Override
//         public Class getBasePropertyClass() {
//             return Long.class;
//         }
// 
//         @Override
//         public Long interpolate(Long from, Long to, float timelinePosition) {
//             return (long) (from + (to - from) * timelinePosition);
//         }
//     }
// }
// 
// Path: projects/main/src/main/java/libshapedraw/animation/trident/interpolator/PropertyInterpolator.java
// public interface PropertyInterpolator<T> {
//     public Class getBasePropertyClass();
// 
//     public T interpolate(T from, T to, float timelinePosition);
// }
// 
// Path: projects/main/src/main/java/libshapedraw/animation/trident/interpolator/PropertyInterpolatorSource.java
// public interface PropertyInterpolatorSource {
//     public Set<PropertyInterpolator> getPropertyInterpolators();
// }


// Path: projects/main/src/main/java/libshapedraw/animation/trident/TridentConfig.java
import java.io.*;
import java.net.URL;
import java.util.*;
import libshapedraw.animation.trident.TimelineEngine.TridentAnimationThread;
import libshapedraw.animation.trident.interpolator.CorePropertyInterpolators;
import libshapedraw.animation.trident.interpolator.PropertyInterpolator;
import libshapedraw.animation.trident.interpolator.PropertyInterpolatorSource;


    public synchronized void addPropertyInterpolator(
            PropertyInterpolator pInterpolator) {
        this.propertyInterpolators.add(pInterpolator);
    }

    public synchronized void addPropertyInterpolatorSource(
            PropertyInterpolatorSource pInterpolatorSource) {
        this.propertyInterpolators.addAll(pInterpolatorSource
                .getPropertyInterpolators());
    }

    public synchronized void removePropertyInterpolator(
            PropertyInterpolator pInterpolator) {
        this.propertyInterpolators.remove(pInterpolator);
    }

    public synchronized void addUIToolkitHandler(
            UIToolkitHandler uiToolkitHandler) {
        this.uiToolkitHandlers.add(uiToolkitHandler);
    }

    public synchronized void removeUIToolkitHandler(
            UIToolkitHandler uiToolkitHandler) {
        this.uiToolkitHandlers.remove(uiToolkitHandler);
    }

    public synchronized void setPulseSource(PulseSource pulseSource) {
        TridentAnimationThread current = TimelineEngine.getInstance().animatorThread;
        if ((current != null) && current.isAlive())

            throw new IllegalStateException(
