com.miginfocom.ashape.animation.animations
Class BasicStrokeAnimation

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

public class BasicStrokeAnimation
extends AbstractAnimation

Animates over a BasicStroke.

Animates width, miterlimit, dashes and dash_phase.

The array that holds the dashes must be of equal length (or both null)

cap and join will be taken from sStroke unless for the last frame (perc == 1.0f) for which it will be taken from eStroke.

See Also:
Serialized Form

Constructor Summary
BasicStrokeAnimation(java.awt.BasicStroke sStroke, java.awt.BasicStroke eStroke)
          Constructor for no precalculated values.
BasicStrokeAnimation(java.awt.BasicStroke sStroke, java.awt.BasicStroke eStroke, int cacheFrameCount)
          Constructor.
 
Method Summary
protected  void assertCompatible(java.awt.BasicStroke sStroke, java.awt.BasicStroke eStroke)
          Throws a IllegalArgumentException if the values don't have the same number of elements for the dash array.
protected  java.lang.Object createObject(float perc)
          Returns a newly created object that complies to the same rules as AbstractAnimation.getObject(float).
 boolean equals(java.lang.Object o)
           
 java.awt.BasicStroke getEndValue()
          Returns value 2.
 java.awt.BasicStroke getStartValue()
          Returns value 1.
 
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

BasicStrokeAnimation

public BasicStrokeAnimation(java.awt.BasicStroke sStroke,
                            java.awt.BasicStroke eStroke)
Constructor for no precalculated values. n1 and n2 needs to be of same type.

Currently handles: Integer, Long, Float and Double.

Parameters:
sStroke - The first value. Not null.
eStroke - The second value. Not null.
See Also:
AbstractAnimation

BasicStrokeAnimation

public BasicStrokeAnimation(java.awt.BasicStroke sStroke,
                            java.awt.BasicStroke eStroke,
                            int cacheFrameCount)
Constructor. n1 and n2 needs to be of same type.

Currently handles: Integer, Long, Float and Double.

Parameters:
sStroke - The first value. Not null.
eStroke - The second value. Not null.
cacheFrameCount - The number of cached values. Use to create a "set" of values so that the AbstractAnimation.getObject(float) won't have to make new once for every call.
See Also:
AbstractAnimation
Method Detail

createObject

protected java.lang.Object createObject(float perc)
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:
perc - 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(java.awt.BasicStroke sStroke,
                                java.awt.BasicStroke eStroke)
Throws a IllegalArgumentException if the values don't have the same number of elements for the dash array.

Parameters:
sStroke - The start value
eStroke - The end value

getStartValue

public java.awt.BasicStroke getStartValue()
Returns value 1.

Returns:
The first value.

getEndValue

public java.awt.BasicStroke getEndValue()
Returns value 2.

Returns:
The second value.

equals

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


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.