SimJava
v2.0

eduni.simdiag
Class GraphEqn

java.lang.Object
  |
  +--eduni.simdiag.GraphEqn
All Implemented Interfaces:
java.lang.Runnable

public class GraphEqn
extends java.lang.Object
implements java.lang.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


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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 java.lang.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
v2.0

The University of Edinburgh, 2002