Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes

jscicalc.button.EqualsButton Class Reference

EqualsButton requests that CalculatorApplet object evaluates the current expression (shown in EntryLabel) and show the result in DisplayPanel. More...

Collaboration diagram for jscicalc.button.EqualsButton:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 EqualsButton (CalculatorApplet applet)
 The standard constructor.
void actionPerformed (java.awt.event.ActionEvent actionEvent)
 The EqualsButton action is to ask the CalculatorApplet object to evaluate the current expression (regardless or the caret position (see EntrlLabel), possibly adding an Ans object if that is needed and the user could reasonably have implied it.

Protected Types

enum  ChangeBase {
  BINARY, OCTAL, DECIMAL, HEXADECIMAL,
  NONE
}
 

What Base can we change to (NONE means no change).

More...

Protected Member Functions

 EqualsButton ()
 Constructor used by HexButton, DecButton, OctButton and BinButton.

Protected Attributes

ChangeBase changeBase
 An enum indicating whether actionPerformed() should change base and if so to what.

Private Member Functions

void setBase ()
 Used by actionPerformed() to set the Base of the calculator, which is stored in the CalculatorApplet object and displayed in the ExtraPanel.

Static Private Attributes

static final long serialVersionUID = 1L

Detailed Description

EqualsButton requests that CalculatorApplet object evaluates the current expression (shown in EntryLabel) and show the result in DisplayPanel.

Additionally it asks for the last object in the Parser (last PObject object of expression) and depending on the value it gets may add an Ans Object to the expression before asking that it be evaluated.

Author:
J. D. Lamb
Version:
Revision:
1.6

Member Enumeration Documentation

What Base can we change to (NONE means no change).

Enumerator:
BINARY 
OCTAL 
DECIMAL 
HEXADECIMAL 
NONE 

Constructor & Destructor Documentation

jscicalc.button.EqualsButton.EqualsButton (  )  [protected]

Constructor used by HexButton, DecButton, OctButton and BinButton.

Although they all use the EqualsButton.actionListener(), we should still setup the objects before adding the ActionListener and so we don’t use EqualsButton( CalculatorApplet ).

jscicalc.button.EqualsButton.EqualsButton ( CalculatorApplet  applet  ) 

Member Function Documentation

void jscicalc.button.EqualsButton.actionPerformed ( java.awt.event.ActionEvent  actionEvent  ) 
void jscicalc.button.EqualsButton.setBase (  )  [private]

Used by actionPerformed() to set the Base of the calculator, which is stored in the CalculatorApplet object and displayed in the ExtraPanel.

Note that the function uses a local ChangeBase object and so can be NONE, indicating no change of base. Thus the default action here is to do nothing.

References jscicalc.button.EqualsButton.changeBase, jscicalc.button.CalculatorButton.getApplet(), and jscicalc.CalculatorApplet.setBase().

Referenced by jscicalc.button.EqualsButton.actionPerformed().


Member Data Documentation

final long jscicalc.button.EqualsButton.serialVersionUID = 1L [static, private]

The documentation for this class was generated from the following file: