com.miginfocom.ashape.animation.animations
Class ImageAnimation

java.lang.Object
  extended by com.miginfocom.ashape.animation.animations.AbstractAnimation
      extended by com.miginfocom.ashape.animation.animations.ImageAnimation
All Implemented Interfaces:
Animation, java.io.Serializable

public class ImageAnimation
extends AbstractAnimation

Animation that fades in one Image over another.

See Also:
GfxUtil.getCrossImage(java.awt.Image, java.awt.Image, java.awt.image.BufferedImage, int, float, boolean), Serialized Form

Constructor Summary
ImageAnimation(java.awt.Image sImg, java.awt.Image eImg, int cacheFrameCount, int transp, boolean fadeSImg)
          Constructor.
 
Method Summary
protected  java.lang.Object createObject(float f)
          Returns a newly created object that complies to the same rules as AbstractAnimation.getObject(float).
 boolean equals(java.lang.Object o)
           
 java.awt.Image getEndImage()
          Returns the second image.
 boolean getFadeStartImage()
          Returns the "fade out image 1 flag".
 java.awt.Image getStartImage()
          Returns the first image.
 int getTransparency()
          Returns the transparency of the returned image.
 
Methods inherited from class com.miginfocom.ashape.animation.animations.AbstractAnimation
createCache, createCacheImpl, getFrameCount, getObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageAnimation

public ImageAnimation(java.awt.Image sImg,
                      java.awt.Image eImg,
                      int cacheFrameCount,
                      int transp,
                      boolean fadeSImg)
Constructor.

Parameters:
sImg - The first image. May be null which creates a fade in of sImg.
eImg - The second image. May be null which creates a fade out of eImg.
cacheFrameCount - The number if frames to pre cache. If 0 the frames are calculated on the fly (not recomended due to slow speed).
transp - The transparency of the returned image. E.g. Transparency.TRANSLUCENT.
fadeSImg - If true im1 are faded away when im2 are faded in. This will make the background shine through in the middle of the f range but creates better results if im2 is partially transparent/translucent since im1 won't just "pop away" at the last frame.
Method Detail

createObject

protected java.lang.Object createObject(float f)
Description copied from class: AbstractAnimation
Returns a newly created object that complies to the same rules as AbstractAnimation.getObject(float). For subclasses to implement.

Specified by:
createObject in class AbstractAnimation
Parameters:
f - 0.0 to 1.0 0.0 is the first Object/frame and 1.0 is the last.
Returns:
A newly created object that complies to the same rules as AbstractAnimation.getObject(float).

getStartImage

public java.awt.Image getStartImage()
Returns the first image.

Returns:
The first image. May be null

getEndImage

public java.awt.Image getEndImage()
Returns the second image.

Returns:
The second image. May be null

getTransparency

public int getTransparency()
Returns the transparency of the returned image. E.g. Transparency.TRANSLUCENT.

Returns:
The transparency of the returned image.

getFadeStartImage

public boolean getFadeStartImage()
Returns the "fade out image 1 flag". See contructor for more info

Returns:
The "fade out image 1" flag

equals

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


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.