|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Animation interface that must be used for all Animations. All methods must be implemented to allow the Animation Object to be used in all animation applications.
Status fields are provided for usage in Animation objects involving status and mesages. Others may be added if necessary.
Field Summary | |
static java.lang.String |
ANIMATION_MESSAGE
Constant for the MESSAGE status. |
static java.lang.String |
BEGIN
Constant for the BEGIN status. |
static java.lang.String |
FINISH
Constant for the FINISH status. |
static java.lang.String |
PAUSE
Constant for the PAUSE status. |
static java.lang.String |
PLAY
Constant for the PLAY status. |
static java.lang.String |
REDRAW
Constant for the REDRAW status. |
static java.lang.String |
REWIND
Constant for the REVERSE status. |
static java.lang.String |
STEP
Constant for the STEP status. |
static java.lang.String |
STOP
Constant for the STOP status. |
Method Summary | |
void |
addAnimationListener(AnimationListener l)
Adds an animationListener that recieves meaningful events from the animation, according to the Animation interface and the AnimationEvent . |
void |
addDescription(java.lang.String d)
Adds a description that may be used to describe to the listener the type of event occuring. |
void |
drawAnimation(java.awt.Graphics2D g2)
Draws the animation of the next step, using the status of the animation (Animation.PLAY, Animation.PAUSE and so forth). |
void |
drawAnimation(java.awt.Graphics2D g2,
java.lang.String status)
Draws the animation of the next step, using the status of the animation (Animation.PLAY, Animation.PAUSE and so forth). |
java.lang.String |
getDescription()
Gets the description added with addDescription and should be accessed through the listener. |
java.lang.String |
getStatus()
Gets the status of the Animation using a command within Animation interface. |
boolean |
getStep()
Gets whether the current animation is in stepping mode or not. |
int |
getStepTime()
Gets the step size for the animation. |
void |
removeAnimationListener(AnimationListener l)
Removes an animationListener from the animation, according to the Animation interface and the AnimationEvent . |
void |
setStatus(java.lang.String cmd)
Sets the status of the Animation using a command within Animation interface. |
void |
setStep(boolean b)
Sets whether the current animation is in stepping mode or not. |
void |
setStepTime(int t)
Sets the step size for the animation. |
Field Detail |
public static final java.lang.String BEGIN
public static final java.lang.String STOP
public static final java.lang.String PLAY
public static final java.lang.String REWIND
public static final java.lang.String PAUSE
public static final java.lang.String FINISH
public static final java.lang.String REDRAW
public static final java.lang.String STEP
public static final java.lang.String ANIMATION_MESSAGE
Method Detail |
public void setStepTime(int t)
t
- the step sizepublic int getStepTime()
public void addAnimationListener(AnimationListener l)
AnimationEvent
.
l
- the listener for the AnimationEvents occuring within this Animation.public void removeAnimationListener(AnimationListener l)
AnimationEvent
.
l
- the listener removed from recieving the AnimationEvents occuring within this Animation.public void addDescription(java.lang.String d)
getDescription
.
d
- the string defining the description.public java.lang.String getDescription()
addDescription
and should be accessed through the listener.
public void setStep(boolean b)
b
- boolean defining whether it is skipping.public boolean getStep()
public void setStatus(java.lang.String cmd)
Animation
interface.
cmd
- cmd that the Animation's status is set to.public java.lang.String getStatus()
Animation
interface.
public void drawAnimation(java.awt.Graphics2D g2)
The starting status of the animation is defined as Animation.PLAY
public void drawAnimation(java.awt.Graphics2D g2, java.lang.String status)
g2
- the graphics to which the animation step should be drawn.status
- the starting status of the animation (what the animation is set to, if in a starting phase like BEGIN or STEP).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |