sub_arctic.anim
Class animation_agent

java.lang.Object
  |
  +--sub_arctic.input.dispatch_agent
        |
        +--sub_arctic.anim.animation_agent

public class animation_agent
extends dispatch_agent

This is the dispatch agent which handles animation input events and dispatches them to interface objects via the animatable input protocol interface. Animation events are generated by a single instance of the anim_generator class that runs in its own thread.


Field Summary
protected  java.util.Vector pending
          This is one of the three queues for use with this agent.
protected  java.util.Vector running
          This is one of the three queues for use with this agent.
protected  java.util.Vector unknown
          This is one of the three queues for use with this agent.
 
Constructor Summary
animation_agent()
          Initialize this agent.
 
Method Summary
 boolean dispatch_event(event evt, java.lang.Object user_info, interactor to_obj, int seq_num)
          Handle an animation event.
 boolean event_is_useful(event evt)
          Is this event one we care about (an ANIMATION_EVENT)?
protected  void insert_into_pending(transition t)
          This method puts a new transition in the pending list.
 void remove_transition(transition target)
          This function causes the animation agent to terminate a transition.
 void schedule_transition(transition t)
          Schedule a transition on behalf of some interactor. This is the principal API for user level code to use to schedule animations.
 
Methods inherited from class sub_arctic.input.dispatch_agent
after_dispatch_notify, dispatch_unused_event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unknown

protected java.util.Vector unknown
This is one of the three queues for use with this agent. The "unknown" queue is for transitions whose start or end times are as yet unknown. The "pending" queue is for transitions which have known start and end times, but are not yet due to run. The "running" queue is for the transitions that are currently executing.

pending

protected java.util.Vector pending
This is one of the three queues for use with this agent. The "unknown" queue is for transitions whose start or end times are as yet unknown. The "pending" queue is for transitions which have known start and end times, but are not yet due to run. The "running" queue is for the transitions that are currently executing.

running

protected java.util.Vector running
This is one of the three queues for use with this agent. The "unknown" queue is for transitions whose start or end times are as yet unknown. The "pending" queue is for transitions which have known start and end times, but are not yet due to run. The "running" queue is for the transitions that are currently executing.
Constructor Detail

animation_agent

public animation_agent()
Initialize this agent. This is done automatically, users should not have to construct this object.
Method Detail

dispatch_event

public boolean dispatch_event(event evt,
                              java.lang.Object user_info,
                              interactor to_obj,
                              int seq_num)
Handle an animation event. These periodically get put in the event "queue" by the animation agent and picked up here.

Parameters:
event - evt the event to dispatch
Object - user_info the user information passed to the agent when the user object joined the focus set
interactor - to_obj the object to dispatch to
int - seq_num the sequence number of this event
Returns:
boolean true if one of our animatable objects handled the event
Overrides:
dispatch_event in class dispatch_agent

event_is_useful

public boolean event_is_useful(event evt)
Is this event one we care about (an ANIMATION_EVENT)?
Parameters:
event - evt the event to test
Returns:
boolean true if we are interested in this event
Overrides:
event_is_useful in class dispatch_agent

schedule_transition

public void schedule_transition(transition t)
Schedule a transition on behalf of some interactor.

This is the principal API for user level code to use to schedule animations. You should pass the transition to this function and the agent will set things up for you.

Parameters:
transition - t the transition you want executed (this contains a reference to the animatable object in the transition)

insert_into_pending

protected void insert_into_pending(transition t)
This method puts a new transition in the pending list. This list is ordered by start time.
Parameters:
transition - t the transition to insert

remove_transition

public void remove_transition(transition target)
This function causes the animation agent to terminate a transition. A transition may be terminated even before it has begun. If you terminate a running transition, other transitions which are dependent on it ending are triggered. If you terminate a transition which has not yet begun, other pending transitions which are dependent on this transition starting or ending are NOT triggered. Attempting to remove a transition which is neither pending nor running has no effect. Currently, this does not result in call to the end_transition method of your animatable object. The reason it current doesn't do this is to make sure that people who are just using the end_transition message as a trigger for time-based events do not receive this call.
Parameters:
transition - target the transition you want removed.