net.rim.device.api.animation
Class AbstractAnimation

java.lang.Object
  extended by net.rim.device.api.animation.AbstractAnimation
Direct Known Subclasses:
Animation, AnimationGroup

public abstract class AbstractAnimation
extends Object

An abstract class that defines the base functionality shared by Animation and AnimationGroup.

See Also:
Animation, AnimationGroup
Since:
BlackBerry API 6.0.0

Method Summary
 void addBeginTrigger(AnimationTrigger beginTrigger, long beginTriggerDelay)
           Adds a begin trigger to the animation.
 void addEndTrigger(AnimationTrigger endTrigger, long endTriggerDelay)
           Adds an end trigger to the animation.
abstract  void begin(long beginDelay)
          Schedules the animation to begin after the specified delay.
abstract  void end(long endDelay)
          Schedules the animation to end after the specified delay.
 Animator getAnimator()
           Gets the Animator the animation animates on.
 AnimationTrigger getBeginTrigger()
          Gets the AnimationTrigger that is fired when the animation begins.
 AnimationTrigger getEndTrigger()
           Gets the AnimationTrigger that is fired when the animation ends.
 AnimationListener getListener()
           Gets the AnimationListener on the animation.
 String getName()
          Gets the name of the animation.
 float getSpeed()
           Gets the speed factor of the animation.
 boolean hasBeginTriggers()
          Indicates if the animation has any begin triggers.
 boolean hasEndTriggers()
           Indicates if the animation has any end triggers.
 boolean isStarted()
          Indicates if the animation has started.
 void removeAllBeginTriggers()
           Removes all begin triggers on the animation.
 void removeAllEndTriggers()
           Removes all end triggers on the animation.
 void removeBeginTrigger(AnimationTrigger beginTrigger)
           Removes the specified begin trigger from the animation.
 void removeEndTrigger(AnimationTrigger endTrigger)
           Removes the specified end trigger from the animation.
 void setListener(AnimationListener listener)
           Sets the AnimationListener on the animation.
 void setName(String name)
          Sets the name of the animation.
 void setSpeed(float speed)
           Sets the speed factor of the animation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

begin

public abstract void begin(long beginDelay)
Schedules the animation to begin after the specified delay.

If a negative value is passed in for beginDelay the animation will start partway through with that magnitude of time elapsed into the animation's total duration. For example, calling begin(800) on an animation with a duration of 500 ms and a repeat count of 2 would start the animation 80% through, at 300 ms into the second iteration of the animation.

Parameters:
beginDelay - The delay before the animation begins.
Since:
BlackBerry API 6.0.0

end

public abstract void end(long endDelay)
Schedules the animation to end after the specified delay.

Parameters:
endDelay - The delay before the animation ends.
Since:
BlackBerry API 6.0.0

setName

public void setName(String name)
Sets the name of the animation.

Parameters:
name - The name of the animation.
Since:
BlackBerry API 6.0.0

getName

public String getName()
Gets the name of the animation.

Returns:
The name of the animation.
Since:
BlackBerry API 6.0.0

isStarted

public boolean isStarted()
Indicates if the animation has started.

Returns:
true if the animation has started, false if the animation has not started.
Since:
BlackBerry API 6.0.0

getSpeed

public float getSpeed()

Gets the speed factor of the animation. Elapsed time is multiplied by this factor to speed up or slow down the animation. The default value is 1.0f.

Returns:
The speed factor.
Since:
BlackBerry API 6.0.0

setSpeed

public void setSpeed(float speed)

Sets the speed factor of the animation. Elapsed time is multiplied by this factor to speed up or slow down the animation. The default value is 1.0f.

Parameters:
speed - The speed factor.
Since:
BlackBerry API 6.0.0

getBeginTrigger

public AnimationTrigger getBeginTrigger()
Gets the AnimationTrigger that is fired when the animation begins. This can be used to schedule animations on the animation's begin event.

Returns:
the trigger fired when the animation begins.
See Also:
AnimationTrigger
Since:
BlackBerry API 6.0.0

getEndTrigger

public AnimationTrigger getEndTrigger()

Gets the AnimationTrigger that is fired when the animation ends. This can be used to schedule animations on the animation's end event.

Returns:
the trigger fired when the animation ends.
See Also:
AnimationTrigger
Since:
BlackBerry API 6.0.0

hasBeginTriggers

public boolean hasBeginTriggers()
Indicates if the animation has any begin triggers.

Returns:
returns true if the animation has begin triggers, false if the animation has no begin triggers.
See Also:
AnimationTrigger
Since:
BlackBerry API 6.0.0

addBeginTrigger

public void addBeginTrigger(AnimationTrigger beginTrigger,
                            long beginTriggerDelay)

Adds a begin trigger to the animation. The animation will begin when the given AnimationTrigger is fired.

If beginTrigger already exists on the animation, the trigger delay will be updated with beginTriggerDelay. When the given trigger is fired the animation will begin after the specified delay.

Parameters:
beginTrigger - The trigger that will cause the animation to begin.
beginTriggerDelay - The delay before the animation begins after the trigger is fired.
Throws:
IllegalArgumentException - if beginTrigger is null.
IllegalArgumentException - if beginTrigger is this animation's begin or end trigger.
See Also:
AnimationTrigger, AbstractAnimation.getBeginTrigger(), AbstractAnimation.getEndTrigger()
Since:
BlackBerry API 6.0.0

removeBeginTrigger

public void removeBeginTrigger(AnimationTrigger beginTrigger)

Removes the specified begin trigger from the animation. Does nothing if beginTrigger is not a trigger on the animation.

Parameters:
beginTrigger - The begin trigger to remove from the animation.
Throws:
IllegalArgumentException - if beginTrigger is null.
See Also:
AnimationTrigger, AbstractAnimation.addBeginTrigger(AnimationTrigger, long), AbstractAnimation.hasBeginTriggers()
Since:
BlackBerry API 6.0.0

removeAllBeginTriggers

public void removeAllBeginTriggers()

Removes all begin triggers on the animation.

See Also:
AnimationTrigger, AbstractAnimation.addBeginTrigger(AnimationTrigger,long), AbstractAnimation.hasBeginTriggers()
Since:
BlackBerry API 6.0.0

hasEndTriggers

public boolean hasEndTriggers()

Indicates if the animation has any end triggers.

Returns:
returns true if the animation has end triggers, false if the animation has no end triggers.
See Also:
AnimationTrigger
Since:
BlackBerry API 6.0.0

addEndTrigger

public void addEndTrigger(AnimationTrigger endTrigger,
                          long endTriggerDelay)

Adds an end trigger to the animation. The animation will end when the specified AnimationTrigger is fired.

If endTrigger already exists on the animation, the trigger delay will be updated with endTriggerDelay. When the given trigger is fired the animation will end after the specified delay.

Parameters:
endTrigger - The end trigger to add.
endTriggerDelay - The delay after the trigger is fired before the end of the animation.
Throws:
IllegalArgumentException - if endTrigger is null.
IllegalArgumentException - if endTrigger is this animation's begin or end trigger.
IllegalArgumentException - if endTriggerDelay < 0.
See Also:
AnimationTrigger, AbstractAnimation.getBeginTrigger(), AbstractAnimation.getEndTrigger()
Since:
BlackBerry API 6.0.0

removeEndTrigger

public void removeEndTrigger(AnimationTrigger endTrigger)

Removes the specified end trigger from the animation. Does nothing if endTrigger is not a trigger on the animation.

Parameters:
endTrigger - The end trigger to remove.
Throws:
IllegalArgumentException - if endTrigger is null.
See Also:
AnimationTrigger, AbstractAnimation.addEndTrigger(AnimationTrigger, long), AbstractAnimation.hasEndTriggers()
Since:
BlackBerry API 6.0.0

removeAllEndTriggers

public void removeAllEndTriggers()

Removes all end triggers on the animation.

See Also:
AnimationTrigger, AbstractAnimation.addEndTrigger(AnimationTrigger,long), AbstractAnimation.hasEndTriggers()
Since:
BlackBerry API 6.0.0

getListener

public AnimationListener getListener()

Gets the AnimationListener on the animation.

Returns:
the listener that is currently set or null if no listener is set.
See Also:
AnimationListener
Since:
BlackBerry API 6.0.0

setListener

public void setListener(AnimationListener listener)

Sets the AnimationListener on the animation.

Parameters:
listener - the AnimationListener to be set or null to remove a listener.
See Also:
AnimationListener
Since:
BlackBerry API 6.0.0

getAnimator

public Animator getAnimator()

Gets the Animator the animation animates on.

Returns:
The Animator currently set on the animation.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.