edu.cmu.sun.animation
Class TransitionManager

java.lang.Object
  extended by edu.cmu.sun.animation.TransitionManager

public class TransitionManager
extends java.lang.Object

Manages scene transitions after each user action. After each user action, the TransitionManager is used as a central touch-point to transition the scene to an updated state. First, the Model components are told to update their listeners. This causes the Views to add their update commands to the AnimationPlans in the TransitionManager. Finally, the TransitionManager runs each of the three plans: preperation, transition, and consolidation.

Author:
Braden Kowitz

Field Summary
private static AnimationPlan consolidationPlan
           
private static AnimationPlan prepPlan
           
private static AnimationPlan transitionPlan
           
 
Constructor Summary
TransitionManager()
           
 
Method Summary
static AnimationPlan getConsolidationPlan()
          An AnimationPlan meant to consolidate the scene after the transition.
static AnimationPlan getPrepPlan()
          An AnimationPlan meant to prepare the Scene for animation.
static AnimationPlan getTransitionPlan()
          An AnimationPlan meant to visually transition the scene from one state to the next.
private static void runConsolidationPlan()
          Runs the AnimationPlan that cleans up after the transition.
private static void runPrepPlan()
          Runs the AnimationPlan to prepare the scene for the transition.
private static void runTransitionPlan()
          Runs the AnimationPlan that actuially performs the visual transition.
static void updateViews()
          Notifys all ModelListeners, then runs though the Prep, Transition and Consolidation plans.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prepPlan

private static AnimationPlan prepPlan

transitionPlan

private static AnimationPlan transitionPlan

consolidationPlan

private static AnimationPlan consolidationPlan
Constructor Detail

TransitionManager

public TransitionManager()
Method Detail

getPrepPlan

public static AnimationPlan getPrepPlan()
An AnimationPlan meant to prepare the Scene for animation. No movement should appear to happen during the prep plan. This plan is often used to re-arrange the scene graph to ready it for a transition animation.


getTransitionPlan

public static AnimationPlan getTransitionPlan()
An AnimationPlan meant to visually transition the scene from one state to the next. This is the bulk of what the user sees when an animation takes place. Most acctions are added to this plan.


getConsolidationPlan

public static AnimationPlan getConsolidationPlan()
An AnimationPlan meant to consolidate the scene after the transition. Many times, an animation will require the scene graph to be structured in a specific way. However, interaction may require the graph to be structured differently. Because of this, the consolidation plan is used to handle any last-minute cleanup after the animation has completed.


updateViews

public static void updateViews()
Notifys all ModelListeners, then runs though the Prep, Transition and Consolidation plans. Since Scenegraph updates are expensive, we only update the scene graph right before we are ready to do a transition. So, each Model is asked to send a modelChanded() event. Then, the various AnimationPlans are run in oder.


runPrepPlan

private static void runPrepPlan()
Runs the AnimationPlan to prepare the scene for the transition.


runTransitionPlan

private static void runTransitionPlan()
Runs the AnimationPlan that actuially performs the visual transition.


runConsolidationPlan

private static void runConsolidationPlan()
Runs the AnimationPlan that cleans up after the transition. Often times, this involves re-building components to be interactive again.