com.jgoodies.animation
Class AbstractAnimationFunction

java.lang.Object
  extended by com.jgoodies.animation.AbstractAnimationFunction
All Implemented Interfaces:
AnimationFunction

public abstract class AbstractAnimationFunction
extends java.lang.Object
implements AnimationFunction

An abstract class that minimizes the effort required to implement the AnimationFunction interface.

Version:
$Revision: 1.1 $
Author:
Karsten Lentzsch
See Also:
AnimationFunctions

Constructor Summary
protected AbstractAnimationFunction(long duration)
          Constructs an AbstractAnimationFunction using the given duration.
 
Method Summary
protected  void checkTimeRange(long time)
          Checks whether the given time is in the valid time range, that is a non-negative time that is smaller than this function's duration.
 long duration()
          Returns this animation function's duration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jgoodies.animation.AnimationFunction
valueAt
 

Constructor Detail

AbstractAnimationFunction

protected AbstractAnimationFunction(long duration)
Constructs an AbstractAnimationFunction using the given duration.

Parameters:
duration - the function's duration
Throws:
java.lang.IllegalArgumentException - if the duration is negative
Method Detail

checkTimeRange

protected void checkTimeRange(long time)
Checks whether the given time is in the valid time range, that is a non-negative time that is smaller than this function's duration. If not, an IllegalArgumentException is thrown.

Parameters:
time - the time to be checked
Throws:
java.lang.IllegalArgumentException - if the time is outside the valid time range

duration

public final long duration()
Returns this animation function's duration.

Specified by:
duration in interface AnimationFunction
Returns:
this animation function's duration


Copyright © 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved.