org.jdesktop.animation.timing
Interface TimingTarget

All Known Implementing Classes:
ObjectModifier, TimingController

public interface TimingTarget

This interface provides three methods which are called by TimingController during the course of a timing sequence. Applications that wish to receive timing events will either create a subclass of TimingController and override or they can create or use an implementation of TimingTarget and pass that into the constructor of TimingController.


Method Summary
 void begin()
          This method is called when the timer first starts.
 void end()
          This method is called when the timer ends, either due to the timing sequence ending naturally or due to a call to TimingController.stop().
 void timingEvent(long cycleElapsedTime, long totalElapsedTime, float fraction)
          Implementors will override this method and pass the TimingTarget into the TimingController constructor in order to receive timing events.
 

Method Detail

timingEvent

void timingEvent(long cycleElapsedTime,
                 long totalElapsedTime,
                 float fraction)
Implementors will override this method and pass the TimingTarget into the TimingController constructor in order to receive timing events.

Parameters:
cycleElapsedTime - the total time in milliseconds elapsed in the current Cycle
totalElapsedTime - the total time in milliseconds elapsed since the start of the first cycle
fraction - the fraction of completion between the start and end of the current cycle. Note that on reversing cycles (Envelope.RepeatBehavior.REVERSE) the fraction decreases from 1.0 to 0 on backwards-running cycles.
See Also:
Envelope.RepeatBehavior, TimingController.timingEvent(long, long, float)

begin

void begin()
This method is called when the timer first starts. It allows the application to perform any initialization that must be done prior to receiving timing events.


end

void end()
This method is called when the timer ends, either due to the timing sequence ending naturally or due to a call to TimingController.stop(). Applications may want to put custom cleanup code in this method.