Class ui.Display
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ui.Display

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----ui.Display

public class Display
extends Panel
A calculator display. It normally contains a graph drawing area and a result showing area.

Variable Index

 o expression
Expression to be calculated or drawn by the display.
 o graphArea
The graph drawing area.
 o resultArea
The result showing area.
 o resultStr
The result to be shown.
 o titleBar
The title bar.

Constructor Index

 o Display()
Construct a default empty display.

Method Index

 o appendSymbol(Symbol)
Take a new input symbol in the calculation mode.
 o clean()
Clean the whole display including the graph and result area.
 o drawGraph(String)
Take an expression string, draw it in the graph area.
 o evalExpression(String)
Take an expression string, evaluate it and display the result in result area.
 o newExpression()
Start a new expression.
 o setCalcMode()
Change the display to calculating mode.
 o setPlotMode()
Change the display to plotting (graph drawing) mode.
 o setTitleBar(String)
Set title bar message.

Variables

 o expression
  public Expression expression
Expression to be calculated or drawn by the display.
 o titleBar
  public Label titleBar
The title bar.
 o resultArea
  public Label resultArea
The result showing area.
 o resultStr
  public String resultStr
The result to be shown.
 o graphArea
  public Graph graphArea
The graph drawing area.

Constructors

 o Display
  public Display()
Construct a default empty display.

Methods

 o setTitleBar
  public void setTitleBar(String str)
Set title bar message.
 o appendSymbol
  public void appendSymbol(Symbol sym)
Take a new input symbol in the calculation mode. The new symbol will be appended to the existing expression, the evaluated result is then shown on the result area.
 o drawGraph
  public void drawGraph(String s)
Take an expression string, draw it in the graph area. The expression string will also be display at result area as well. The string is of the form expr(X)[xmin,xmax].
 o evalExpression
  public void evalExpression(String s)
Take an expression string, evaluate it and display the result in result area.
 o clean
  public void clean()
Clean the whole display including the graph and result area.
 o newExpression
  public void newExpression()
Start a new expression. This will not clean the graph area.
 o setPlotMode
  public void setPlotMode()
Change the display to plotting (graph drawing) mode.
 o setCalcMode
  public void setCalcMode()
Change the display to calculating mode.

All Packages  Class Hierarchy  This Package  Previous  Next  Index