com.sun.lwuit.animations
Class Transition

java.lang.Object
  extended by com.sun.lwuit.animations.Transition
All Implemented Interfaces:
Animation
Direct Known Subclasses:
CommonTransitions, Transition3D

public abstract class Transition
extends java.lang.Object
implements Animation

Represents a transition animation between two forms this class is used internally by Display to play an animation when moving from one form to the next. A transition can be installed on a Form object using the in/out transitions, for ease of use LookAndFeel has support for default transitions.


Constructor Summary
Transition()
           
 
Method Summary
abstract  boolean animate()
          Allows the animation to reduce "repaint" calls when it returns false.
protected  void cleanSource()
          Allows setting the source form to null to save memory if the transition doesn't need it in memory.
 void cleanup()
          Optional operation to cleanup the garbage left over by a running transition
 Transition copy(boolean reverse)
          Create a copy of the transition, usually the transition used is a copy.
 Component getDestination()
          Returns the destination form that should be set once animation is completed
 Component getSource()
          Returns the source form which is the form from which the animation is starting.
 void init(Component source, Component destination)
          Invoked by Display to set the source and destination forms.
 void initTransition()
          Callback thats invoked before a transition begins, the source form may be null for the first form in the application.
abstract  void paint(Graphics g)
          Draws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transition

public Transition()
Method Detail

init

public final void init(Component source,
                       Component destination)
Invoked by Display to set the source and destination forms. This method should not be invoked by developers.

Parameters:
source - the source form from which the transition originates
destination - the destination form to which the transition will lead

initTransition

public void initTransition()
Callback thats invoked before a transition begins, the source form may be null for the first form in the application.


getDestination

public final Component getDestination()
Returns the destination form that should be set once animation is completed

Returns:
the destination component

getSource

public final Component getSource()
Returns the source form which is the form from which the animation is starting. This may be null for the first form in the application

Returns:
the source component

cleanup

public void cleanup()
Optional operation to cleanup the garbage left over by a running transition


copy

public Transition copy(boolean reverse)
Create a copy of the transition, usually the transition used is a copy.

Parameters:
reverse - creates a new transition instance with "reverse" behavior useful for signifying "back" operations
Returns:
new transition instance

cleanSource

protected final void cleanSource()
Allows setting the source form to null to save memory if the transition doesn't need it in memory.


animate

public abstract boolean animate()
Description copied from interface: Animation
Allows the animation to reduce "repaint" calls when it returns false. It is called once for every frame. Frames are defined by the Display class.

Specified by:
animate in interface Animation
Returns:
true if a repaint is desired or false if no repaint is necessary

paint

public abstract void paint(Graphics g)
Description copied from interface: Animation
Draws the animation, within a component the standard paint method would be invoked since it bares the exact same signature.

Specified by:
paint in interface Animation
Parameters:
g - graphics context