org.concord.molecular.ui
Class AtomicValueDispatcher

java.lang.Object
  |
  +--org.concord.molecular.ui.AtomicValueDispatcher
All Implemented Interfaces:
AtomicDataListener

public class AtomicValueDispatcher
extends java.lang.Object
implements AtomicDataListener

An instance of this class moderates the interaction between a ValueGraph and the DefaultAtomicModel. AtomicValue objects are added and subsequently used to calculate values from the model.


Field Summary
protected  DefaultAtomicModel atomicModel
           
protected  javax.swing.event.ChangeEvent changeEvent
           
protected static int DEFAULT_INTERVAL
           
protected  int interval
           
protected  java.util.Vector listeners
           
protected  int nextStep
           
protected  ValueGraph valueGraph
           
protected  java.util.Vector values
           
 
Constructor Summary
AtomicValueDispatcher()
           
 
Method Summary
 void addAtomicValue(ConditionValue value)
          The AtomicValue object represents a specific model calculation.
 void atomicDataUpdate(AtomicDataEvent event)
          This is the event handler for the model generated calculation events.
 int getInterval()
          This returns the graph interval.
 ValueGraph getValueGraph()
          Get the current object that implements ValueGraph
 void removeAtomicValue(ConditionValue value)
          This method removes the AtomicValue from the graph.
 void setAtomicModel(DefaultAtomicModel model)
           
 void setAtomicValue(ConditionValue value, int index)
          Sets an atomic value for a particular index.
 void setInterval(int value)
          This sets the graph interval.
 void setValueGraph(ValueGraph graph)
          Set the ValueGraph object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

protected java.util.Vector values

atomicModel

protected DefaultAtomicModel atomicModel

DEFAULT_INTERVAL

protected static final int DEFAULT_INTERVAL

interval

protected int interval

nextStep

protected int nextStep

valueGraph

protected ValueGraph valueGraph

changeEvent

protected javax.swing.event.ChangeEvent changeEvent

listeners

protected java.util.Vector listeners
Constructor Detail

AtomicValueDispatcher

public AtomicValueDispatcher()
Method Detail

getValueGraph

public ValueGraph getValueGraph()
Get the current object that implements ValueGraph

setValueGraph

public void setValueGraph(ValueGraph graph)
Set the ValueGraph object. This has to be done before the data can be displayed.

getInterval

public int getInterval()
This returns the graph interval. This interval is the number of times the model calls this AtomicDataListener for each graph point update.

setInterval

public void setInterval(int value)
This sets the graph interval.

setAtomicValue

public void setAtomicValue(ConditionValue value,
                           int index)
Sets an atomic value for a particular index.

Parameters:
value - AtomicValue the value.
index - int graph element index.

addAtomicValue

public void addAtomicValue(ConditionValue value)
The AtomicValue object represents a specific model calculation. This method adds it to this graph.

removeAtomicValue

public void removeAtomicValue(ConditionValue value)
This method removes the AtomicValue from the graph.

setAtomicModel

public void setAtomicModel(DefaultAtomicModel model)

atomicDataUpdate

public void atomicDataUpdate(AtomicDataEvent event)
This is the event handler for the model generated calculation events.
Specified by:
atomicDataUpdate in interface AtomicDataListener