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.
-
Graph()
- Constructs a Graph-object without a title.
-
Graph(String)
- Constructs a Graph-object with a title.
-
add(double)
- Adds the entry (time(), y) to the graph.
-
add(double, double)
- Adds the entry (x, y) to the graph.
-
add(Variable)
- Adds the entry (time(), v.state) to the graph.
-
add(Variable, Variable)
- Adds the entry (v1.state, v2.state) to the graph.
-
setLocation(int, int)
- Sets the location of the frame.
-
setTitle(String)
- Sets the title of the graph.
-
setXLabel(String)
- Sets a label on the x-axis.
-
setYLabel(String)
- Sets a label on the y-axis.
-
show()
- Shows the graph in a frame of width 400 and height 400.
-
show(int, int)
- Shows the graph in a frame.
Graph
public Graph()
- Constructs a Graph-object without a title.
Graph
public Graph(java.lang.String title)
- Constructs a Graph-object with a title.
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.
add
public void add(double y)
- Adds the entry (time(), y) to the graph.
- Parameters:
- y - the y-value.
add
public void add(jDisco.Variable v)
- Adds the entry (time(), v.state) to the graph.
- Parameters:
- v - the Variable-object.
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.
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.
show
public void show()
- Shows the graph in a frame of width 400 and height 400.
setTitle
public void setTitle(java.lang.String title)
- Sets the title of the graph.
- Parameters:
- title - the title.
setXLabel
public void setXLabel(java.lang.String label)
- Sets a label on the x-axis.
- Parameters:
- label - the label.
setYLabel
public void setYLabel(java.lang.String label)
- Sets a label on the y-axis.
- Parameters:
- label - the label.
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