Class ui.Graph
All Packages Class Hierarchy This Package Previous Next Index
Class ui.Graph
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----ui.Graph
- public class Graph
- extends Canvas
A graph object which plots an expression given [xmin, xmax] range.
It can also be used to display multi-line messages.
-
DRAW_EXPRESSION
- Mode of plotting expression.
-
DRAW_MESSAGE
- Mode of drawing multi-line messages.
-
DRAW_NOTHING
- Mode of drawing blank graph.
-
expression
- The expression to be plot.
-
mode
- Current mode of graph.
-
msgString
- The message to be displayed.
-
xmax
- Maximum x value of [xmin, xmax] range.
-
xmin
- Minumum x value of [xmin, xmax] range.
-
Graph()
- Construct a empty graph.
-
Graph(Expression, double, double)
- Construct a graph with an expression and [xmin, xmax] range.
-
paint(Graphics)
- Paint the graph.
-
setExpression(Expression)
- Set the expression to be plot.
-
setMode(int)
- Set plotting mode.
-
setMsgString(String)
- Set message string.
-
setXRange(double, double)
- Set the range of expression to be plot.
DRAW_NOTHING
public final static int DRAW_NOTHING
- Mode of drawing blank graph.
DRAW_MESSAGE
public final static int DRAW_MESSAGE
- Mode of drawing multi-line messages.
DRAW_EXPRESSION
public final static int DRAW_EXPRESSION
- Mode of plotting expression.
xmin
public double xmin
- Minumum x value of [xmin, xmax] range.
xmax
public double xmax
- Maximum x value of [xmin, xmax] range.
expression
public Expression expression
- The expression to be plot.
msgString
public String msgString
- The message to be displayed.
mode
public int mode
- Current mode of graph.
Graph
public Graph()
- Construct a empty graph.
Graph
public Graph(Expression expr,
double xmin,
double xmax)
- Construct a graph with an expression and [xmin, xmax] range.
setExpression
public void setExpression(Expression expr)
- Set the expression to be plot.
setXRange
public void setXRange(double xmin,
double xmax)
- Set the range of expression to be plot.
setMode
public void setMode(int m)
- Set plotting mode.
setMsgString
public void setMsgString(String s)
- Set message string.
paint
public synchronized void paint(Graphics g)
- Paint the graph.
- Overrides:
- paint in class Canvas
All Packages Class Hierarchy This Package Previous Next Index