org.deken.game.animation
Class DissolveAnimation

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

public class DissolveAnimation
extends BaseAnimation

Title: DissolveAnimation

Description: TODO

Copyright: Copyright (c) Dec 26, 2012

Version:
1.0
Author:
Gary Deken

Nested Class Summary
static class DissolveAnimation.DIRECTION
           
 
Field Summary
 
Fields inherited from class org.deken.game.animation.BaseAnimation
height, imageEffect, name, sequenceTime, sound, totalDuration, totalFrames, width, xOffset, yOffset
 
Constructor Summary
protected DissolveAnimation()
          Used by copy().
  DissolveAnimation(java.awt.Image image, long unused)
          This takes the base image that will be dissolved from.
 
Method Summary
 void addFrame(java.awt.Image image, long duration)
          This method set the image that will be behind the dissolving image.
 DissolveAnimation copy()
          Copy Animation
 void draw(java.awt.Graphics2D graphics, int x, int y)
          Draws the dissolved image, 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 setDissolve(int percent, DissolveAnimation.DIRECTION direction)
           
 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

DissolveAnimation

public DissolveAnimation(java.awt.Image image,
                         long unused)
This takes the base image that will be dissolved from.

Parameters:
image - The image that will dissolve.
unused -

DissolveAnimation

protected DissolveAnimation()
Used by copy().

Method Detail

addFrame

public void addFrame(java.awt.Image image,
                     long duration)
This method set the image that will be behind the dissolving image.

Parameters:
image - Background image.
duration - long

copy

public DissolveAnimation copy()
Copy Animation

Returns:
DissolveAnimation

draw

public void draw(java.awt.Graphics2D graphics,
                 int x,
                 int y)
Draws the dissolved image, 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

setDissolve

public void setDissolve(int percent,
                        DissolveAnimation.DIRECTION direction)