com.miginfocom.ashape.animation.animations
Class ColorAnimation

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

public class ColorAnimation
extends AbstractAnimation

Animates from one Color to another.

See Also:
GfxUtil.getCrossColor(java.awt.Color, java.awt.Color, float)., Serialized Form

Constructor Summary
ColorAnimation(java.awt.Color sCol, java.awt.Color eCol)
          Constructor for no precalculated colors (frames).
ColorAnimation(java.awt.Color sCol, java.awt.Color eCol, int cacheFrameCount)
          Constructor.
 
Method Summary
protected  java.lang.Object createObject(float f)
          Creates a new object, not using the frame cache even if it exists.
 boolean equals(java.lang.Object o)
           
 java.awt.Color getEndColor()
          Returns the end color.
 java.awt.Color getStartColor()
          Returns the start color.
 
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

ColorAnimation

public ColorAnimation(java.awt.Color sCol,
                      java.awt.Color eCol)
Constructor for no precalculated colors (frames).

Parameters:
sCol - AtStart color. Not null.
eCol - AtEnd color. Not null.

ColorAnimation

public ColorAnimation(java.awt.Color sCol,
                      java.awt.Color eCol,
                      int cacheFrameCount)
Constructor.

Parameters:
sCol - AtStart color. Not null.
eCol - AtEnd color. Not null.
cacheFrameCount - If > 0 that number of colors will be precached and returned by AbstractAnimation.getObject(float). No more colors will be constructed after the constructor. If == 0, new colors will be calculated and returned for every call, this can create a lot of garbage and consume CPU cycles.
Method Detail

createObject

protected java.lang.Object createObject(float f)
Creates a new object, not using the frame cache even if it exists.

Specified by:
createObject in class AbstractAnimation
Parameters:
f - 0..1 0.0 is the first object and 1.0 is the last.
Returns:
A new object, not using the frame cache even if it exists.

getStartColor

public java.awt.Color getStartColor()
Returns the start color.

Returns:
The start color.

getEndColor

public java.awt.Color getEndColor()
Returns the end color.

Returns:
The end color.

equals

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


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.