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.

Variable Index

 o DRAW_EXPRESSION
Mode of plotting expression.
 o DRAW_MESSAGE
Mode of drawing multi-line messages.
 o DRAW_NOTHING
Mode of drawing blank graph.
 o expression
The expression to be plot.
 o mode
Current mode of graph.
 o msgString
The message to be displayed.
 o xmax
Maximum x value of [xmin, xmax] range.
 o xmin
Minumum x value of [xmin, xmax] range.

Constructor Index

 o Graph()
Construct a empty graph.
 o Graph(Expression, double, double)
Construct a graph with an expression and [xmin, xmax] range.

Method Index

 o paint(Graphics)
Paint the graph.
 o setExpression(Expression)
Set the expression to be plot.
 o setMode(int)
Set plotting mode.
 o setMsgString(String)
Set message string.
 o setXRange(double, double)
Set the range of expression to be plot.

Variables

 o DRAW_NOTHING
  public final static int DRAW_NOTHING
Mode of drawing blank graph.
 o DRAW_MESSAGE
  public final static int DRAW_MESSAGE
Mode of drawing multi-line messages.
 o DRAW_EXPRESSION
  public final static int DRAW_EXPRESSION
Mode of plotting expression.
 o xmin
  public double xmin
Minumum x value of [xmin, xmax] range.
 o xmax
  public double xmax
Maximum x value of [xmin, xmax] range.
 o expression
  public Expression expression
The expression to be plot.
 o msgString
  public String msgString
The message to be displayed.
 o mode
  public int mode
Current mode of graph.

Constructors

 o Graph
  public Graph()
Construct a empty graph.
 o Graph
  public Graph(Expression expr,
               double xmin,
               double xmax)
Construct a graph with an expression and [xmin, xmax] range.

Methods

 o setExpression
  public void setExpression(Expression expr)
Set the expression to be plot.
 o setXRange
  public void setXRange(double xmin,
                        double xmax)
Set the range of expression to be plot.
 o setMode
  public void setMode(int m)
Set plotting mode.
 o setMsgString
  public void setMsgString(String s)
Set message string.
 o paint
  public synchronized void paint(Graphics g)
Paint the graph.
Overrides:
paint in class Canvas

All Packages  Class Hierarchy  This Package  Previous  Next  Index