SimJava 2.0.1

eduni.simdiag
Class GraphEqn

Object
  extended by GraphEqn
All Implemented Interfaces:
Runnable

public class GraphEqn
extends Object
implements Runnable

Generates sin/cos graph from equation. The output format is a stream of GraphEventObjects which can be read and displayed by a GraphDiagram. This class may be useful as an example of how to generate a graph from user simulations: see the source code


Field Summary
(package private)  Thread thread
           
 
Constructor Summary
GraphEqn()
          Creates a graph generator (Sine, Cos)
 
Method Summary
 void addGraphListener(GraphListener l)
          Adds a graph listener
 void forwardGraph(GraphEventObject e)
          Forwards a graph event to anyone listening.
 void removeGraphListener(GraphListener l)
          Removes a graph listener
 void run()
          Generates the graph
 void startRunning()
          Called after output has been wired
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thread

transient Thread thread
Constructor Detail

GraphEqn

public GraphEqn()
Creates a graph generator (Sine, Cos)

Method Detail

startRunning

public void startRunning()
Called after output has been wired


run

public void run()
Generates the graph

Specified by:
run in interface Runnable

addGraphListener

public void addGraphListener(GraphListener l)
Adds a graph listener


removeGraphListener

public void removeGraphListener(GraphListener l)
Removes a graph listener


forwardGraph

public void forwardGraph(GraphEventObject e)
Forwards a graph event to anyone listening.


SimJava 2.0.1

The University of Edinburgh, 2009