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

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 |
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.
enum jscicalc::button::EqualsButton::ChangeBase [protected] |
| 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 | ) |
The standard constructor.
It knows about the applet.
| applet | The controller object. |
References jscicalc.button.EqualsButton.changeBase, jscicalc.button.CalculatorButton.pobject, jscicalc.button.CalculatorButton.setText(), jscicalc.button.CalculatorButton.setTextSize(), jscicalc.button.CalculatorButton.setToolTipText(), jscicalc.button.CalculatorButton.shortcut(), and jscicalc.button.CalculatorButton.tooltip().
| void jscicalc.button.EqualsButton.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.
| actionEvent | The event that generated this method call: usually a button press or called when CalculatorApplet responded to the key associated with this button |
Reimplemented from jscicalc.button.CalculatorButton.
References jscicalc.button.CalculatorButton.applet, jscicalc.Parser.evaluate(), jscicalc.button.CalculatorButton.getApplet(), jscicalc.Parser.getLast(), jscicalc.CalculatorApplet.getMode(), jscicalc.CalculatorApplet.getParser(), jscicalc.CalculatorApplet.getValue(), jscicalc.CalculatorApplet.insert(), jscicalc.CalculatorApplet.newExpression(), jscicalc.button.CalculatorButton.pobject, jscicalc.CalculatorApplet.pushHistory(), jscicalc.button.EqualsButton.setBase(), jscicalc.CalculatorApplet.setMode(), jscicalc.CalculatorApplet.setShift(), jscicalc.CalculatorApplet.setValue(), jscicalc.pobject.Ans.setValue(), and jscicalc.CalculatorApplet.updateDisplay().
| 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().
ChangeBase jscicalc.button.EqualsButton.changeBase [protected] |
An enum indicating whether actionPerformed() should change base and if so to what.
Referenced by jscicalc.button.BinButton.BinButton(), jscicalc.button.DecButton.DecButton(), jscicalc.button.EqualsButton.EqualsButton(), jscicalc.button.HexButton.HexButton(), jscicalc.button.OctButton.OctButton(), and jscicalc.button.EqualsButton.setBase().
final long jscicalc.button.EqualsButton.serialVersionUID = 1L [static, private] |
Reimplemented from jscicalc.button.CalculatorButton.
Reimplemented in jscicalc.button.BinButton, jscicalc.button.DecButton, jscicalc.button.HexButton, and jscicalc.button.OctButton.
1.7.1