|
Java DTV API 1.0 12-Dec-2008 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.lwuit.animations.Transition
Represents a transition animation between two forms this class is used
internally by DTVContainer
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.
Field Summary |
Fields inherited from interface com.sun.dtv.ui.Animated |
ALTERNATING, LOOP, REPEATING |
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. |
abstract Transition |
copy()
Copies a transitions. |
int |
getAnimationMode()
Obtains the animation mode for this animation. The animation mode determines how the animation is running: always forwards, or forwards and backwards alternating. |
int |
getDelay()
Obtains the delay after every image for this animation when running. |
Component |
getDestination()
Returns the destination form that should be set once animation is completed. |
int |
getPosition()
Obtains the current position the animation is at the point of time of th method call. An animation can be considered as a row of images, this method provides the index within this row. |
int |
getRepetitionMode()
Returns the repetition mode of this animation in form of a number. The number reads how many repetitions have been determined for this animation. |
Component |
getSource()
Returns the source form which is the form from which the animation is starting. |
void |
init(Component source,
Component destination)
Invoked 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. |
boolean |
isRunning()
Obtains the running mode of an animation. Returns true if the animation is running, false otherwise. |
void |
jumpTo(int position)
Forces an animation to jump to the position indicated by the parameter. An animation can be considered as a row of images, the parameter of this method provides the index within this row. If the animation is stopped, a call to this method causes the animation to show the image at the indicated position, but not to start. If the animation is running, a call to this method causes the animation to jump to the image at the indicated position and continue running immediately. |
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. |
void |
setAnimationMode(int mode)
Sets the animation mode for this animation. The animation mode determines how the animation is running: always forwards, or forwards and backwards alternating. |
void |
setDelay(long n)
Determines the delay after every image when running this animation. |
void |
setRepetitionMode(int n)
Determines how often the animation is repeated once it has been started. |
void |
start()
Starts an animation. Please consider that an animation is in the stopped mode per default, so it has to be started explicitly once it has been created. In case the animation is already running, a call to start()
causes a restart of the animation. |
void |
stop()
Stops an animation. In case the animation is already stopped, the call to stop() has no effect. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Transition()
Method Detail |
public final void init(Component source, Component destination)
source
- the source form from which the transition originatesdestination
- the destination form to which the transition will leadpublic void initTransition()
public final Component getDestination()
public final Component getSource()
public void cleanup()
public abstract Transition copy()
protected final void cleanSource()
public abstract boolean animate()
Animated
animate
in interface Animated
Animated.setAnimationMode(int)
public abstract void paint(Graphics g)
Animated
paint
in interface Animated
g
- the Graphics object to draw onpublic void start()
start()
causes a restart of the animation.
start
in interface Animated
public void stop()
stop()
has no effect.
stop
in interface Animated
public boolean isRunning()
isRunning
in interface Animated
public void jumpTo(int position)
jumpTo
in interface Animated
position
- the index in the row of images building the animation to which
the animation is forced to jumppublic int getPosition()
getPosition
in interface Animated
public void setRepetitionMode(int n)
setRepetitionMode
in interface Animated
n
- number of repetitions to be determined. This can be any number
larger than zero or LOOP
alternatively.
LOOP means that the animation runs in an endless loop until the stop()
method has been called.getRepetitionMode()
public int getRepetitionMode()
getRepetitionMode
in interface Animated
LOOP
which means the animation runs in an
endless loop until the stop()
method has
been called.setRepetitionMode(int)
public void setDelay(long n)
setDelay
in interface Animated
n
- delay in millisecondsgetDelay()
public int getDelay()
getDelay
in interface Animated
setDelay(long)
public void setAnimationMode(int mode)
setAnimationMode
in interface Animated
mode
- the animation mode. Possible values are: REPEATING
and ALTERNATING
.getAnimationMode()
public int getAnimationMode()
getAnimationMode
in interface Animated
REPEATING
and ALTERNATING
.setAnimationMode(int)
|
Java DTV API 1.0 12-Dec-2008 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |