com.miginfocom.ashape.animation.animations
Class ShapeGradientPaintAnimation

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

public class ShapeGradientPaintAnimation
extends AbstractAnimation

An animation that animates between two ShapeGradientPaint objects. Both paints must have the same mode (ShapeGradientPaint.MODE_ANGLE or ShapeGradientPaint.MODE_COORD)) and if in mode COORD the corresponding coords needs to be of same type (relative or absolute). Cyclic and auto scale must also match.
The reason for this is that we don't have the relative size values that has to be used to convert relative values to absolute.

See Also:
Serialized Form

Constructor Summary
ShapeGradientPaintAnimation(ShapeGradientPaint st, ShapeGradientPaint en)
          Constructor without cached objects.
ShapeGradientPaintAnimation(ShapeGradientPaint st, ShapeGradientPaint en, int cacheFrameCount)
          Constructor.
 
Method Summary
protected  void assertCompatible(ShapeGradientPaint startPaint, ShapeGradientPaint endPaint)
          Throws a IllegalArgumentException if the gradient paints aren't compatible for animation.
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)
           
 ShapeGradientPaint getEndPaint()
          Returns the end ShapeGradientPaint.
 ShapeGradientPaint getStartPaint()
          Returns the start ShapeGradientPaint.
 
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

ShapeGradientPaintAnimation

public ShapeGradientPaintAnimation(ShapeGradientPaint st,
                                   ShapeGradientPaint en)
Constructor without cached objects. Creates new on-the-fly for every call. This can be expensive and may create a lot of garbage.

Parameters:
st - The source, or start, ShapeGradientPaint. Not null.
en - The destination, or end, ShapeGradientPaint. Not null.

ShapeGradientPaintAnimation

public ShapeGradientPaintAnimation(ShapeGradientPaint st,
                                   ShapeGradientPaint en,
                                   int cacheFrameCount)
Constructor.

Parameters:
st - The source, or start, ShapeGradientPaint.
en - The destination, or end, ShapeGradientPaint.
cacheFrameCount - How many frames that should be cached, and used. 0 means "no caching".
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).

assertCompatible

protected void assertCompatible(ShapeGradientPaint startPaint,
                                ShapeGradientPaint endPaint)
Throws a IllegalArgumentException if the gradient paints aren't compatible for animation.

Parameters:
startPaint - The start Paint
endPaint - The end paint

getStartPaint

public ShapeGradientPaint getStartPaint()
Returns the start ShapeGradientPaint.

Returns:
The start ShapeGradientPaint.

getEndPaint

public ShapeGradientPaint getEndPaint()
Returns the end ShapeGradientPaint.

Returns:
The end ShapeGradientPaint.

equals

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


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.