All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jDisco.Graph

java.lang.Object
   |
   +----jDisco.Graph

public class Graph
extends java.lang.Object
This class facilitates curve plotting.

A Graph-object represents a graph.

An entry (x,y) is added to the graph by calling add(x,y).

The graph is shown in a frame by calling its show-method.


Constructor Index

 o Graph()
Constructs a Graph-object without a title.
 o Graph(String)
Constructs a Graph-object with a title.

Method Index

 o add(double)
Adds the entry (time(), y) to the graph.
 o add(double, double)
Adds the entry (x, y) to the graph.
 o add(Variable)
Adds the entry (time(), v.state) to the graph.
 o add(Variable, Variable)
Adds the entry (v1.state, v2.state) to the graph.
 o setLocation(int, int)
Sets the location of the frame.
 o setTitle(String)
Sets the title of the graph.
 o setXLabel(String)
Sets a label on the x-axis.
 o setYLabel(String)
Sets a label on the y-axis.
 o show()
Shows the graph in a frame of width 400 and height 400.
 o show(int, int)
Shows the graph in a frame.

Constructors

 o Graph
 public Graph()
Constructs a Graph-object without a title.

 o Graph
 public Graph(java.lang.String title)
Constructs a Graph-object with a title.

Methods

 o add
 public void add(double x,
                 double y)
Adds the entry (x, y) to the graph.

Parameters:
x - the x-value.
y - the y-value.
 o add
 public void add(double y)
Adds the entry (time(), y) to the graph.

Parameters:
y - the y-value.
 o add
 public void add(jDisco.Variable v)
Adds the entry (time(), v.state) to the graph.

Parameters:
v - the Variable-object.
 o add
 public void add(jDisco.Variable v1,
                 jDisco.Variable v2)
Adds the entry (v1.state, v2.state) to the graph.

Parameters:
v1 - the first Variable-object.
v2 - the second Variable-object.
 o show
 public void show(int width,
                  int height)
Shows the graph in a frame.

Parameters:
width - the width of the frame.
height - the height of the frame.
 o show
 public void show()
Shows the graph in a frame of width 400 and height 400.

 o setTitle
 public void setTitle(java.lang.String title)
Sets the title of the graph.

Parameters:
title - the title.
 o setXLabel
 public void setXLabel(java.lang.String label)
Sets a label on the x-axis.

Parameters:
label - the label.
 o setYLabel
 public void setYLabel(java.lang.String label)
Sets a label on the y-axis.

Parameters:
label - the label.
 o setLocation
 public void setLocation(int x,
                         int y)
Sets the location of the frame.

Parameters:
x - the x-coordinate on the screen.
y - the y-coordinate on the screen.

All Packages  Class Hierarchy  This Package  Previous  Next  Index