Java DTV API 1.3
18-Nov-2009

com.sun.dtv.lwuit.animations
Class CommonTransitions

java.lang.Object
  extended by com.sun.dtv.lwuit.animations.Transition
      extended by com.sun.dtv.lwuit.animations.CommonTransitions
All Implemented Interfaces:
Animation, Animated

public final class CommonTransitions
extends Transition

Contains common transition animations including the following.

Instances of this class are created using factory methods.


Field Summary
static int SLIDE_HORIZONTAL
          Slide the transition horizontally.
static int SLIDE_VERTICAL
          Slide the transition vertically.
 
Fields inherited from interface com.sun.dtv.ui.Animated
ALTERNATING, LOOP, REPEATING
 
Method Summary
 boolean animate()
          Allows the animation to reduce "repaint" calls when it returns false.
 void cleanup()
          Optional operation to cleanup the garbage left over by a running transition.
 Transition copy()
          Copies a transitions.
static CommonTransitions createEmpty()
          Creates an empty transition that does nothing.
static CommonTransitions createFade(int duration)
          Creates a transition for fading a form in while fading out the original form.
static CommonTransitions createSlide(int type, boolean forward, int duration)
          Creates a slide transition with the given duration and direction.
static CommonTransitions createSlide(int type, boolean forward, int duration, boolean drawDialogMenu)
          Creates a slide transition with the given duration and direction.
 Motion getMotion()
          Motion represents the physical movement within a transition, it can be replaced by the user to provide a more appropriate physical feel.
 void initTransition()
          Callback thats invoked before a transition begins, the source form may be null for the first form in the application.
 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 setMotion(Motion motion)
          Motion represents the physical movement within a transition, it can be replaced by the user to provide a more appropriate physical feel.
 
Methods inherited from class com.sun.dtv.lwuit.animations.Transition
getAnimationMode, getDelay, getDestination, getPosition, getRepetitionMode, getSource, init, isRunning, jumpTo, setAnimationMode, setDelay, setRepetitionMode, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SLIDE_HORIZONTAL

public static final int SLIDE_HORIZONTAL
Slide the transition horizontally.

See Also:
createSlide(int, boolean, int), Constant Field Values

SLIDE_VERTICAL

public static final int SLIDE_VERTICAL
Slide the transition vertically.

See Also:
createSlide(int, boolean, int), Constant Field Values
Method Detail

createEmpty

public static CommonTransitions createEmpty()
Creates an empty transition that does nothing. This has the same effect as setting a transition to null.

Returns:
an empty CommonTransitions object

createSlide

public static CommonTransitions createSlide(int type,
                                            boolean forward,
                                            int duration)
Creates a slide transition with the given duration and direction.

Parameters:
type - type can be either vertically or horizontally, which means the movement direction of the transition
forward - forward is a boolean value, represent the directions of switching forms, for example for a horizontally type, true means horizontally movement to right.
duration - represent the time the transition should take in millisecond
Returns:
a transition object

createSlide

public static CommonTransitions createSlide(int type,
                                            boolean forward,
                                            int duration,
                                            boolean drawDialogMenu)
Creates a slide transition with the given duration and direction.

Parameters:
type - type can be either vertically or horizontally, which means the movement direction of the transition
forward - forward is a boolean value, represent the directions of switching forms, for example for a horizontally type, true means horizontally movement to right.
duration - represent the time the transition should take in millisecond
drawDialogMenu - indicates that the menu of the dialog should be kept during a slide transition. This is only relevant for dialog in/out transitions.
Returns:
a transition object

createFade

public static CommonTransitions createFade(int duration)
Creates a transition for fading a form in while fading out the original form.

Parameters:
duration - represent the time the transition should take in millisecond
Returns:
a transition object

initTransition

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

Overrides:
initTransition in class Transition

animate

public 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.

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

paint

public 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
Specified by:
paint in class Transition

cleanup

public void cleanup()
Description copied from class: Transition
Optional operation to cleanup the garbage left over by a running transition.

Overrides:
cleanup in class Transition

getMotion

public Motion getMotion()
Motion represents the physical movement within a transition, it can be replaced by the user to provide a more appropriate physical feel.

Returns:
the instance of the motion class used by this transition
See Also:
setMotion(com.sun.dtv.lwuit.animations.Motion)

setMotion

public void setMotion(Motion motion)
Motion represents the physical movement within a transition, it can be replaced by the user to provide a more appropriate physical feel.

Parameters:
motion - new instance of the motion class that will be used by the transition
See Also:
getMotion()

copy

public Transition copy()
Description copied from class: Transition
Copies a transitions.

Specified by:
copy in class Transition
Returns:
the copied transition

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.