trassare.com

com.trassare.calculator.ui
Class CalculatorGUI

java.lang.Object
  extended by com.trassare.calculator.ui.CalculatorGUI
All Implemented Interfaces:
UserInterface

public class CalculatorGUI
extends Object
implements UserInterface

CalculatorGUI initializes a data structure for all GUI components then renders the GUI.

Version:
11 October 2005
Author:
Samuel Trassare

Nested Class Summary
 class CalculatorGUI.SolveListener
          This is what happens when '=' is pressed.
 
Field Summary
protected static String APP_NAME
          The title, as it appears in the title bar, of this application.
 
Constructor Summary
protected CalculatorGUI()
          Constructor for objects of class CalculatorGUI.
 
Method Summary
 void evaluate(String inputData)
           
static ActionListener[] getActionListeners()
          Get the ActionListeners for the buttons.
static ExpressionScanner getScanner()
          Get the ExpressionScanner that is currently in use.
 void run()
          Run the calculator GUI.
static void setLandF(String load)
          Setter for the look and feel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_NAME

protected static final String APP_NAME
The title, as it appears in the title bar, of this application.

See Also:
Constant Field Values
Constructor Detail

CalculatorGUI

protected CalculatorGUI()
Constructor for objects of class CalculatorGUI.

Method Detail

getActionListeners

public static ActionListener[] getActionListeners()
Get the ActionListeners for the buttons.

Returns:
an array of ActionListeners for the buttons

getScanner

public static ExpressionScanner getScanner()
Get the ExpressionScanner that is currently in use.

Returns:
Returns the scanner.

setLandF

public static void setLandF(String load)
Setter for the look and feel.

Parameters:
load - the look and feel to load

evaluate

public final void evaluate(String inputData)
Specified by:
evaluate in interface UserInterface
Parameters:
inputData - a String containing the mathematical expression that should be evaluated by the calculator engine.

run

public final void run()
Run the calculator GUI.

Specified by:
run in interface UserInterface

trassare.com