org.jdesktop.animation.transitions
Class ScreenTransition

java.lang.Object
  extended by org.jdesktop.animation.transitions.ScreenTransition

public class ScreenTransition
extends java.lang.Object

This class is used to facilitate animated transitions in an application. ScreenTransition is given a container in a Swing application. When the application wishes to transition from one state of the application to another, the startTransition method is called, which calls back into the application to first reset the state of the application, then set up the following state of the application. Then ScreenTransition runs an animation from the previous state of the application to the new state.


Constructor Summary
ScreenTransition(javax.swing.JComponent transitionComponent, TransitionTarget transitionTarget, org.jdesktop.animation.timing.Animator animator)
          ` Constructor that takes an Animator that will be used to drive the ScreenTransition.
ScreenTransition(javax.swing.JComponent transitionComponent, TransitionTarget transitionTarget, int duration)
          Constructor that takes a simple duration.
 
Method Summary
 org.jdesktop.animation.timing.Animator getAnimator()
          Returns Animator object that drives this ScreenTransition.
 void setAnimator(org.jdesktop.animation.timing.Animator animator)
          Sets animator that drives this ScreenTransition.
 void start()
          Begin the transition from the current application state to the next one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenTransition

public ScreenTransition(javax.swing.JComponent transitionComponent,
                        TransitionTarget transitionTarget,
                        int duration)
Constructor that takes a simple duration. The Animator used to drive this ScreenTransition will be created internally.


ScreenTransition

public ScreenTransition(javax.swing.JComponent transitionComponent,
                        TransitionTarget transitionTarget,
                        org.jdesktop.animation.timing.Animator animator)
` Constructor that takes an Animator that will be used to drive the ScreenTransition. Transition will start if either start() is called or Animator.start() is called.

Throws:
java.lang.IllegalStateException - if animator is already running
java.lang.IllegalArgumentException - animator must be non-null
See Also:
Animator.isRunning(), Animator.start()
Method Detail

getAnimator

public org.jdesktop.animation.timing.Animator getAnimator()
Returns Animator object that drives this ScreenTransition.

Returns:
the Animator that drives this ScreenTransition

setAnimator

public void setAnimator(org.jdesktop.animation.timing.Animator animator)
Sets animator that drives this ScreenTransition. Animator cannot be null. Animator also cannot be running when this method is called (because important setup information for ScreenTransition happens at Animator start time). Transition will start if either start() is called or Animator.start() is called.

Parameters:
animator - non-null Animator object that will drive this ScreenTransition. Animator cannot be running when this is called.
Throws:
java.lang.IllegalStateException - if animator is already running
java.lang.IllegalArgumentException - animator must be non-null
See Also:
Animator.isRunning()

start

public void start()
Begin the transition from the current application state to the next one. This method will call into the TransitionTarget specified in the ScreenTransition constructor: setupNextScreen() will be called to allow the application to set up the state of the next screen. After this call, the transition animation will begin.