com.miginfocom.ashape.animation
Class Animator

java.lang.Object
  extended by com.miginfocom.ashape.animation.Animator
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
OverrideAnimator

public abstract class Animator
extends java.lang.Object
implements java.io.Serializable

Contains the basic functionality to wrap an Animation and denote a min/max frames per second. Subclasses implements how the frames maps to time.

See Also:
Serialized Form

Constructor Summary
protected Animator(Animation animation, java.lang.Integer minFps, java.lang.Integer maxFps)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
abstract  boolean executeCommand(AnimatorCommand animatorCommand, Interactor interactor)
          Handles a command.
 Animation getAnimation()
          Returns the contained Animation.
 int getMaxDelay()
          Returns the maximum delay in milliseconds, calculated from minFps (yes, minFps).
 java.lang.Integer getMaxFps()
          Returns the maximum number of frames per second that will ever be painted.
 int getMinDelay()
          Returns the minimum delay in milliseconds, calculated from maxFps (yes, maxFps).
 java.lang.Integer getMinFps()
          Returns the minium number of frames per second that will be painted.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Animator

protected Animator(Animation animation,
                   java.lang.Integer minFps,
                   java.lang.Integer maxFps)
Constructor.

Parameters:
animation - The animation to animate. Not null.
minFps - The minimum number of frames per second that will be painted. null means no min.
Note that when the animation is over there will be no more frames no matter what this value is.
maxFps - The maximum number of frames per second that will ever be painted. null means no max.
Method Detail

executeCommand

public abstract boolean executeCommand(AnimatorCommand animatorCommand,
                                       Interactor interactor)
Handles a command. Up to the subclasses to define vhat can be handled.

Parameters:
animatorCommand - The command.
interactor - The interactor to interact with. Must have a registered AbstractInteractionBroker since it's that object that carries out the commands.
Returns:
false if the animator will keep running or are just paused. false mean that it is safe to remove.

getAnimation

public Animation getAnimation()
Returns the contained Animation. Never null.

Returns:
The contained Animation. Never null.

getMinFps

public java.lang.Integer getMinFps()
Returns the minium number of frames per second that will be painted. Defaults to null. null means no min.
Note that when the animation is over there will be no more frames no matter what this value is.

Returns:
The minium number of frames per second that will be painted. Defaults to null. null means no min.

getMaxFps

public java.lang.Integer getMaxFps()
Returns the maximum number of frames per second that will ever be painted. Defaults to 100. null means no max.

Returns:
The maximum number of frames per second that will ever be painted. Defaults to 100. null means no max.

getMinDelay

public int getMinDelay()
Returns the minimum delay in milliseconds, calculated from maxFps (yes, maxFps). 0 will be returned if there is no minFps.

Returns:
The minimum delay in milliseconds, calculated from maxFps (yes, maxFps).

getMaxDelay

public int getMaxDelay()
Returns the maximum delay in milliseconds, calculated from minFps (yes, minFps). MigUtil.BIG_INT will be returned if there is no minFps.

Returns:
The maximum delay in milliseconds, calculated from minFps (yes, minFps).

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.