org.deken.game.animation
Class StaticAnimation

java.lang.Object
  extended by org.deken.game.animation.BaseAnimation
      extended by org.deken.game.animation.StaticAnimation
All Implemented Interfaces:
java.lang.Cloneable, Animation, Updateable

public class StaticAnimation
extends BaseAnimation

Title: StaticAnimationStrip Description: An animation strip that is only a single frame. Copyright: Copyright (c) 2005

Version:
1.0
Author:
Gary Deken

Field Summary
 
Fields inherited from class org.deken.game.animation.BaseAnimation
height, imageEffect, name, sequenceTime, sound, totalDuration, totalFrames, width, xOffset, yOffset
 
Constructor Summary
protected StaticAnimation()
          Used by copy().
  StaticAnimation(java.awt.Image image)
          Animation Strip
  StaticAnimation(java.awt.Image image, long unused)
           
 
Method Summary
 void addFrame(java.awt.Image image, long duration)
          This method does nothing, since the animation strip, has only a single image.
 StaticAnimation copy()
          Copy Animation
 void draw(java.awt.Graphics2D graphics, int x, int y)
          Draws the current frame index, including any animation offsets.
 boolean equals(java.lang.Object obj)
          Determines if two animation strips are the same, based on size of image and number of frames.
 java.awt.Image getFrame(int i)
          This method returns the only image in the animation.
 java.awt.Image getImage()
          This method returns the current frame of the animation.
 boolean isAnimating()
          This animation strip does not animate, always returning the same image.
 void reset()
          This method does nothing, since there is only a single image, there is nothing to reset.
 void update(long elapseTime)
          This method does nothing, with the static animation strip, the same image is always returned.
 
Methods inherited from class org.deken.game.animation.BaseAnimation
addImageEffect, baseUpdate, copyParent, getHeight, getName, getSound, getTotalDuration, getWidth, getXOffset, getYOffset, setName, setOffsets, setSound
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticAnimation

public StaticAnimation(java.awt.Image image,
                       long unused)
Parameters:
image -
unused -

StaticAnimation

public StaticAnimation(java.awt.Image image)
Animation Strip

Parameters:
image -

StaticAnimation

protected StaticAnimation()
Used by copy().

Method Detail

addFrame

public void addFrame(java.awt.Image image,
                     long duration)
This method does nothing, since the animation strip, has only a single image.

Parameters:
image - Image
duration - long

draw

public void draw(java.awt.Graphics2D graphics,
                 int x,
                 int y)
Draws the current frame index, including any animation offsets.

Parameters:
graphics -
x -
y -

equals

public boolean equals(java.lang.Object obj)
Determines if two animation strips are the same, based on size of image and number of frames.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object
Returns:
boolean

reset

public void reset()
This method does nothing, since there is only a single image, there is nothing to reset.


update

public void update(long elapseTime)
This method does nothing, with the static animation strip, the same image is always returned.

Parameters:
elapseTime - long

getFrame

public java.awt.Image getFrame(int i)
This method returns the only image in the animation.

Parameters:
i - int
Returns:
Image

getImage

public java.awt.Image getImage()
Description copied from interface: Animation
This method returns the current frame of the animation. When it is used with the update method, it will return each image in the sequence as it is updated.

Returns:
Image

isAnimating

public boolean isAnimating()
This animation strip does not animate, always returning the same image.

Returns:
boolean

copy

public StaticAnimation copy()
Copy Animation

Returns:
StaticAnimationStrip