kinetic
Class KineticProperty

java.lang.Object
  |
  +--kinetic.KineticProperty
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
KineticDiscreteProperty

public class KineticProperty
extends java.lang.Object
implements java.io.Serializable

basic class used for storing animatable values in the engine. Stores a continous value with bounding information. Contains a raw unprocessed value with is used at the initial state of each frame. Contains an end)value which contains the process value used to actualyl render the data to the screen.

See Also:
Serialized Form

Field Summary
protected  boolean changed
          indicates if the value shas changed
protected  double endValue
          processed value used to render frame
protected  double initialValue
          raw unprocessed value
protected  double lower_bound
          lower bound
protected  kinetic.KineticObject owner
          the owner of this property
protected  double upper_bound
          upper bound
 
Constructor Summary
KineticProperty()
          construct s anew instance of a KineticPropert
KineticProperty(double new_val)
          create new instance with an initial value
KineticProperty(double new_val, double l_bound, double u_bound)
          create new instance with an initial value and bounds
 
Method Summary
 void addBehavior(kinetic.Behavior b)
          add a behavior to this property
 void applyBehavior(kinetic.Behavior b, double time)
          run the behavior on this property with this value of time
 void clear()
          clears all animation data this property knows about
 void clipValue()
          clips the internal value to the bounds
 java.util.ArrayList getBehaviorList()
          gets the list of behaviors attached to this property
 double getEndValue()
          gets the processed value of this property
 double getInitialValue()
          get the unprocessed initial value of the property
 void handleMouseEvent(java.awt.event.MouseEvent e)
          used to support interactivity
 boolean hasChanged()
          queries if the value changed during last update
static double limit(double test_value, double upper, double lower)
          static utility routine to clip values to given range
 void reset()
          reset internal variables in the property
 void resetEndValue()
          restore the raw value into the end value
 void setMaxValue()
          sets the raw value to the upper bound
 void setMinValue()
          sets the raw value to the lower bound
 void setOwner(kinetic.KineticObject obj)
          sets the own of this property
 void setValue(double val)
          sets the value of this property
 void setValue(long val)
          sets the values of this property with a long
 void update(double time)
          calculate the value for this property given the value of time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

upper_bound

protected double upper_bound
upper bound


lower_bound

protected double lower_bound
lower bound


initialValue

protected double initialValue
raw unprocessed value


endValue

protected double endValue
processed value used to render frame


changed

protected boolean changed
indicates if the value shas changed


owner

protected kinetic.KineticObject owner
the owner of this property

Constructor Detail

KineticProperty

public KineticProperty()
construct s anew instance of a KineticPropert


KineticProperty

public KineticProperty(double new_val)
create new instance with an initial value

Parameters:
new_val - property value

KineticProperty

public KineticProperty(double new_val,
                       double l_bound,
                       double u_bound)
create new instance with an initial value and bounds

Parameters:
new_val - property value
l_bound - lower bound
u_bound - upper bound
Method Detail

limit

public static double limit(double test_value,
                           double upper,
                           double lower)
static utility routine to clip values to given range

Parameters:
test_value - value to clip
upper - upper bound
lower - lower bound
Returns:
clipped value

clipValue

public void clipValue()
clips the internal value to the bounds


setValue

public void setValue(long val)
sets the values of this property with a long

Parameters:
val - new property value

setValue

public void setValue(double val)
sets the value of this property

Parameters:
val - new property value

getInitialValue

public double getInitialValue()
get the unprocessed initial value of the property

Returns:
gets unprocessed value of the property

getEndValue

public double getEndValue()
gets the processed value of this property

Returns:
processed value of the property

hasChanged

public boolean hasChanged()
queries if the value changed during last update

Returns:
true if value changed during last update

setMaxValue

public void setMaxValue()
sets the raw value to the upper bound


setMinValue

public void setMinValue()
sets the raw value to the lower bound


setOwner

public void setOwner(kinetic.KineticObject obj)
sets the own of this property

Parameters:
obj - new owner

addBehavior

public void addBehavior(kinetic.Behavior b)
add a behavior to this property

Parameters:
b - instance of a behavior

update

public void update(double time)
calculate the value for this property given the value of time

Parameters:
time - value of time - ms

handleMouseEvent

public void handleMouseEvent(java.awt.event.MouseEvent e)
used to support interactivity

Parameters:
e - mouse event object

resetEndValue

public void resetEndValue()
restore the raw value into the end value


reset

public void reset()
reset internal variables in the property


clear

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


applyBehavior

public void applyBehavior(kinetic.Behavior b,
                          double time)
run the behavior on this property with this value of time

Parameters:
b - instance of a behavior
time - value of time - ms

getBehaviorList

public java.util.ArrayList getBehaviorList()
gets the list of behaviors attached to this property

Returns:
list of behaviors