kinetic
Class Behavior

java.lang.Object
  |
  +--kinetic.Behavior
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Change, Curve, ExponentialChange, Hop, HopSecondary, Jitter, Oscillate, Pulse, SymmetricCurve, SymmetricCurveSecondary

public abstract class Behavior
extends java.lang.Object
implements java.io.Serializable

base class used for all behaviors. provides the necessary routines that the engine calls to run the animation.

See Also:
Serialized Form

Field Summary
protected  double current_time
          stores the current time
 kinetic.KineticProperty duration
          standard duration property
 boolean isDone
          flag used to indicate completion
protected  kinetic.KineticProperty owner
          stores what property this behavior is attached to
protected  java.util.ArrayList properties
          list of properties the behavior has
protected  java.util.ArrayList timeFilters
          list of time filters attached to the behavior
 
Constructor Summary
protected Behavior()
          constructs and empty behavior
 
Method Summary
 void addTimeFilter(kinetic.TimeFilter tf)
          adds a new entry to this behavior's time filter list
 void apply(double time)
          method called when the animation time is updated
 void clear()
          clears all animation data this behavior knows about
 double getDuration()
          returns the duration of the behavior
 java.util.ArrayList getPropertyList()
          return the list of internal properties
 java.util.ArrayList getTimeFilterList()
          gets the list of timefilters for this object
 boolean isDone()
          returns true is the behavior has completed (currentTime > duration)
 double PrepareVariables(double time)
          utility function to update that values all of internal properties and time filters.
abstract  void Process()
          main routine that calculates a new value for the owner property
 void reset()
          resets all/any persistent values inside the behavior
 void setOwner(kinetic.KineticProperty p)
          sets the owner of this property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

protected kinetic.KineticProperty owner
stores what property this behavior is attached to


properties

protected java.util.ArrayList properties
list of properties the behavior has


timeFilters

protected java.util.ArrayList timeFilters
list of time filters attached to the behavior


duration

public kinetic.KineticProperty duration
standard duration property


current_time

protected double current_time
stores the current time


isDone

public boolean isDone
flag used to indicate completion

Constructor Detail

Behavior

protected Behavior()
constructs and empty behavior

Method Detail

setOwner

public void setOwner(kinetic.KineticProperty p)
sets the owner of this property

Parameters:
p - the owner of this behavior

apply

public void apply(double time)
method called when the animation time is updated

Parameters:
time - new animation

Process

public abstract void Process()
main routine that calculates a new value for the owner property


PrepareVariables

public double PrepareVariables(double time)
utility function to update that values all of internal properties and time filters. Returns the value of time after being processed by any timefilters.

Parameters:
time - aniamtion update time in milliseconds
Returns:
the value of time after being processed by the timefilters this time should be used by the remainder of processing

addTimeFilter

public void addTimeFilter(kinetic.TimeFilter tf)
adds a new entry to this behavior's time filter list

Parameters:
tf - instance of a timefilter

getPropertyList

public java.util.ArrayList getPropertyList()
return the list of internal properties

Returns:
internal list of properties

getDuration

public double getDuration()
returns the duration of the behavior

Returns:
duration of the behavior in milliseconds

isDone

public boolean isDone()
returns true is the behavior has completed (currentTime > duration)

Returns:
returns true if the behavior has completed

reset

public void reset()
resets all/any persistent values inside the behavior


clear

public void clear()
clears all animation data this behavior knows about


getTimeFilterList

public java.util.ArrayList getTimeFilterList()
gets the list of timefilters for this object

Returns:
list of time filters