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.
-
expression
- Expression to be calculated or drawn by the display.
-
graphArea
- The graph drawing area.
-
resultArea
- The result showing area.
-
resultStr
- The result to be shown.
-
titleBar
- The title bar.
-
Display()
- Construct a default empty display.
-
appendSymbol(Symbol)
- Take a new input symbol in the calculation mode.
-
clean()
- Clean the whole display including the graph and result area.
-
drawGraph(String)
- Take an expression string, draw it in the graph area.
-
evalExpression(String)
- Take an expression string, evaluate it and display the result in
result area.
-
newExpression()
- Start a new expression.
-
setCalcMode()
- Change the display to calculating mode.
-
setPlotMode()
- Change the display to plotting (graph drawing) mode.
-
setTitleBar(String)
- Set title bar message.
expression
public Expression expression
- Expression to be calculated or drawn by the display.
titleBar
public Label titleBar
- The title bar.
resultArea
public Label resultArea
- The result showing area.
resultStr
public String resultStr
- The result to be shown.
graphArea
public Graph graphArea
- The graph drawing area.
Display
public Display()
- Construct a default empty display.
setTitleBar
public void setTitleBar(String str)
- Set title bar message.
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.
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].
evalExpression
public void evalExpression(String s)
- Take an expression string, evaluate it and display the result in
result area.
clean
public void clean()
- Clean the whole display including the graph and result area.
newExpression
public void newExpression()
- Start a new expression. This will not clean the graph area.
setPlotMode
public void setPlotMode()
- Change the display to plotting (graph drawing) mode.
setCalcMode
public void setCalcMode()
- Change the display to calculating mode.
All Packages Class Hierarchy This Package Previous Next Index