kinetic
Class KineticDiscreteProperty

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

public class KineticDiscreteProperty
extends KineticProperty
implements java.io.Serializable

specialized version of the nomral KineticProperty. contains a list of items in a lookup array. Treats the value as a bounded double type and rounds it to an index when the value must be retrieved

See Also:
Serialized Form

Field Summary
 
Fields inherited from class kinetic.KineticProperty
changed, endValue, initialValue, lower_bound, owner, upper_bound
 
Constructor Summary
KineticDiscreteProperty()
          creates a new instance of KineticDiscreteProperty
KineticDiscreteProperty(double new_val)
          creates a new instance of KineticDiscreteProperty
KineticDiscreteProperty(double new_val, double l_bound, double u_bound)
          creates a new instance of KineticDiscreteProperty
 
Method Summary
 void addChoice(java.lang.Object c)
          adds a new option the choice list in this property
 void clipValue()
          clips the current value to the defined bounds
 java.lang.Object getChoice(int i)
          get the indexed object from the choice list
 java.lang.Object getEndChoice()
          returns the object pointed by the current value
 double getEndValue()
          gets the rounded interger of the property
 int getSize()
          return the size of the choice list
 void removeChoice(java.lang.Object c)
          removes a particular choice from the choice list
 void setChoices(java.util.ArrayList new_list)
          assigns the linked list inside this property to the one passed
 
Methods inherited from class kinetic.KineticProperty
addBehavior, applyBehavior, clear, getBehaviorList, getInitialValue, handleMouseEvent, hasChanged, limit, reset, resetEndValue, setMaxValue, setMinValue, setOwner, setValue, setValue, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KineticDiscreteProperty

public KineticDiscreteProperty()
creates a new instance of KineticDiscreteProperty


KineticDiscreteProperty

public KineticDiscreteProperty(double new_val)
creates a new instance of KineticDiscreteProperty

Parameters:
new_val - sets the value of this property

KineticDiscreteProperty

public KineticDiscreteProperty(double new_val,
                               double l_bound,
                               double u_bound)
creates a new instance of KineticDiscreteProperty

Parameters:
new_val - sets the value of this property
l_bound - sets the lower bound of the property
u_bound - sets the upper bound of the property
Method Detail

getEndValue

public double getEndValue()
gets the rounded interger of the property

Overrides:
getEndValue in class KineticProperty
Returns:
floor() integer value of the property

getEndChoice

public java.lang.Object getEndChoice()
returns the object pointed by the current value

Returns:
currectly selected object

addChoice

public void addChoice(java.lang.Object c)
adds a new option the choice list in this property

Parameters:
c - instance of an object to be added

setChoices

public void setChoices(java.util.ArrayList new_list)
assigns the linked list inside this property to the one passed

Parameters:
new_list - ArrayList of object choices

removeChoice

public void removeChoice(java.lang.Object c)
removes a particular choice from the choice list

Parameters:
c - object to be removed

getChoice

public java.lang.Object getChoice(int i)
get the indexed object from the choice list

Parameters:
i - index value
Returns:
indexed object

getSize

public int getSize()
return the size of the choice list

Returns:
size of list

clipValue

public void clipValue()
clips the current value to the defined bounds

Overrides:
clipValue in class KineticProperty