standup.clouds
Class AnimatorCloudButton

java.lang.Object
  extended by standup.clouds.AnimatorCloudButton
Direct Known Subclasses:
AnimatorCloudButtonMoveIn, AnimatorCloudButtonMoveOut, AnimatorCloudButtonResize, AnimatorCloudButtonRotateLeft, AnimatorCloudButtonRotateRight, AnimatorCloudButtonStayPut

public abstract class AnimatorCloudButton
extends Object

An instance of AnimatorCloudButton defines a type of animation that can be applied to a CloudButton. When instantiated, the number of frames (and optionally, the frame number at which point animation should start) is registered. It is then given a chance to update the size and location of a CloudButton using the update(int, CloudButton) method.

Author:
Ruli Manurung

Field Summary
(package private)  CloudButton.LineMode lineMode
          Determines whether the line is trailing, leading, or invisible.
(package private)  int steps
          The number of steps the animation should take place over.
(package private)  int stepsOffset
          The n-th frame when the animation should actually start.
 
Constructor Summary
AnimatorCloudButton(int _s, int _o, CloudButton.LineMode _lm)
          Default constructor for an AnimatorCloudButton
 
Method Summary
protected  int getFrame(int realFrame)
          A helper method that computes the 'animation frame', i.e.
(package private) abstract  STANDUPShapeCloudButton getInitialShape(CloudButton thing, PanelCloudButtonMenu bb, ShapeDetails shd)
          This returns the initial 'shape' of the CloudButton to be used by this animation.
(package private) abstract  void update(int realFrame, CloudButton cloudButton)
          A subclass of AnimatorCloudButton must implement this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

steps

final int steps
The number of steps the animation should take place over.


stepsOffset

final int stepsOffset
The n-th frame when the animation should actually start.


lineMode

final CloudButton.LineMode lineMode
Determines whether the line is trailing, leading, or invisible.

Constructor Detail

AnimatorCloudButton

AnimatorCloudButton(int _s,
                    int _o,
                    CloudButton.LineMode _lm)
Default constructor for an AnimatorCloudButton

Parameters:
_s - the number of steps/frames the animation should last
_o - the step/frame number at which point the animation should properly commence
_lm - the LineMode used in this animation
Method Detail

getFrame

protected int getFrame(int realFrame)
A helper method that computes the 'animation frame', i.e. which is used to determine a CloudButton's size and location, given a 'real frame'. The difference between the two is the offset, i.e. the number of frames at the beginning when animation hasn't started yet.

Parameters:
realFrame - the 'real' frame number
Returns:
the 'animation' frame number

update

abstract void update(int realFrame,
                     CloudButton cloudButton)
A subclass of AnimatorCloudButton must implement this method. It is used to update the given CloudButton's location and size given the 'real' frame.

Parameters:
realFrame -
cloudButton - the CloudButton being animated

getInitialShape

abstract STANDUPShapeCloudButton getInitialShape(CloudButton thing,
                                                 PanelCloudButtonMenu bb,
                                                 ShapeDetails shd)
This returns the initial 'shape' of the CloudButton to be used by this animation.

Parameters:
thing -
bb -
shd -
Returns: