
Public Member Functions | |
| DisplayPanel | displayPanel () |
| Designed so that CalculatorPanel and its subclasses can use the displayPanel object as required. | |
| int | displayHeight (int minSize) |
| Find the display height at minSize. | |
| int | buttonHeight (int minSize) |
| Find the button height at minSize. | |
| int | buttonWidth (int minSize) |
| Find the button width at minSize. | |
| int | strutSize (int minSize) |
| Find the strut size at minSize. | |
| int | displayHeight () |
| The height of the LCD display in pixels. | |
| int | buttonHeight () |
| The height of a standard button. | |
| int | buttonWidth () |
| The width of a standard button. | |
| int | strutSize () |
| If you look at the CalculatorPanel objects, you’ll see that the buttons are grouped. | |
| int | minSize () |
| If you look at the CalculatorPanel objects, you’ll see that there’s a minimum gap between most objects. | |
| float | buttonTextSize () |
| Get the size of text to use on buttons. | |
| float | entryTextSize () |
| Get the size of text to use on the EntryLabel object. | |
| float | displayTextSize () |
| Get the size of text to use on the DisplayPanel.This reports the size of text for calculator ‘output’. | |
| float | extraTextSize () |
| Get the size of small text to use on the DisplayPanel object. | |
| boolean | getOn () |
| Tells us if the calculator is switched on. | |
| boolean | getShift () |
| Tells us if the shift button is down. | |
| Parser | getParser () |
| The Parser class is the model that this class controls. | |
| OObject | getValue () |
| This is used internally, but it’s also useful if you want to use the calculator as part of something else. | |
| OObject | getMemory () |
| Get the value from memory. | |
| AngleType | getAngleType () |
| Find whether we’re working in degrees or radians. | |
| boolean | getStat () |
| We can emulate a STAT mode and this is how we find out if we’re doing so. | |
| int | getMode () |
| As you’d expect for something emulating a real calculator, we’d better have a mode button. | |
| Mean | statMean () |
| Calculate the mean value. | |
| Complex | statSumSquares () |
| Calculate sum of squares - used in standard deviation/variance calculations. | |
| StDev | statSampleStDev () |
| Calculate the sample standard deviation. | |
| PopStDev | statPopulationStDev () |
| Calculate the population standard deviation. | |
| javax.swing.JFrame | frame () |
| Another function whose purpose eludes me. | |
| Base | getBase () |
| We work in various bases. | |
| Notation | getNotation () |
| Get notation (scientific, polar, complex). | |
| java.awt.Insets | getFrameInsets () |
| Get the frame Insets. | |
| int | graphHeight () |
| Get height for Graph. | |
| int | getSizesSize () |
| Find the size of sizes. | |
| int | getMinSize () |
| Find the minimum size of CalculatorApplet.mSize. | |
It’s rather like using a pointer to const class in C++ to restrict to const members, but Java doesn’t have const members.
| DisplayPanel jscicalc.ReadOnlyCalculatorApplet.displayPanel | ( | ) |
Designed so that CalculatorPanel and its subclasses can use the displayPanel object as required.
Implemented in jscicalc.CalculatorApplet.
| int jscicalc.ReadOnlyCalculatorApplet.displayHeight | ( | int | minSize | ) |
Find the display height at minSize.
| minSize | The minimum size used in the display |
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.DisplayPanel.setUp().
| int jscicalc.ReadOnlyCalculatorApplet.buttonHeight | ( | int | minSize | ) |
Find the button height at minSize.
| minSize | The minimum size used in the display |
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.graph.AxisDialog.setSizes().
| int jscicalc.ReadOnlyCalculatorApplet.buttonWidth | ( | int | minSize | ) |
Find the button width at minSize.
| minSize | The minimum size used in the display |
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.graph.AxisDialog.setSizes(), and jscicalc.DisplayPanel.setUp().
| int jscicalc.ReadOnlyCalculatorApplet.strutSize | ( | int | minSize | ) |
Find the strut size at minSize.
| minSize | The minimum size used in the display |
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.graph.AxisDialog.setSizes(), and jscicalc.DisplayPanel.setUp().
| int jscicalc.ReadOnlyCalculatorApplet.displayHeight | ( | ) |
The height of the LCD display in pixels.
Used so that the view can get this information.
Implemented in jscicalc.CalculatorApplet.
| int jscicalc.ReadOnlyCalculatorApplet.buttonHeight | ( | ) |
The height of a standard button.
Used by CalculatorPanel objects.
Implemented in jscicalc.CalculatorApplet.
| int jscicalc.ReadOnlyCalculatorApplet.buttonWidth | ( | ) |
The width of a standard button.
Used by CalculatorPanel objects.
Implemented in jscicalc.CalculatorApplet.
| int jscicalc.ReadOnlyCalculatorApplet.strutSize | ( | ) |
If you look at the CalculatorPanel objects, you’ll see that the buttons are grouped.
This defines the width of the gap between groups. CalculatorApplet keep control of such things and this function reports them to CalculatorPanel objects when required.
Implemented in jscicalc.CalculatorApplet.
| int jscicalc.ReadOnlyCalculatorApplet.minSize | ( | ) |
If you look at the CalculatorPanel objects, you’ll see that there’s a minimum gap between most objects.
CalculatorApplet keep control of such things and this function reports them to CalculatorPanel objects when required.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.graph.AxisDialog.setSizes(), jscicalc.DisplayPanel.setUp(), and jscicalc.EntryLabel.update().
| float jscicalc.ReadOnlyCalculatorApplet.buttonTextSize | ( | ) |
Get the size of text to use on buttons.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.graph.AxisDialog.setBounds(), and jscicalc.graph.AxisDialog.setSizes().
| float jscicalc.ReadOnlyCalculatorApplet.entryTextSize | ( | ) |
Get the size of text to use on the EntryLabel object.
This is the bit of the DisplayPanel object that’s responsible for showing the current expression.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.EntryLabel.update().
| float jscicalc.ReadOnlyCalculatorApplet.displayTextSize | ( | ) |
Get the size of text to use on the DisplayPanel.This reports the size of text for calculator ‘output’.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.DisplayLabel.setExpression().
| float jscicalc.ReadOnlyCalculatorApplet.extraTextSize | ( | ) |
Get the size of small text to use on the DisplayPanel object.
Small text is for things like “stat”, “radians”, “shift” and the like
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.DisplayPanel.setUp().
| boolean jscicalc.ReadOnlyCalculatorApplet.getOn | ( | ) |
Tells us if the calculator is switched on.
This is useful in view classes because only this class gets to control such information.
Implemented in jscicalc.CalculatorApplet.
| boolean jscicalc.ReadOnlyCalculatorApplet.getShift | ( | ) |
Tells us if the shift button is down.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.ExtraPanel.paintComponent().
| Parser jscicalc.ReadOnlyCalculatorApplet.getParser | ( | ) |
The Parser class is the model that this class controls.
When required, for example, so that we can create a view of the current expression, we use this function to make the Parser object accessible. Ideally it would be final, but it’s convenient to allow CalculatorButton objects to modify the Parser object directly.
Implemented in jscicalc.CalculatorApplet.
| OObject jscicalc.ReadOnlyCalculatorApplet.getValue | ( | ) |
This is used internally, but it’s also useful if you want to use the calculator as part of something else.
In fact, the calculator was really originally designed because I couldn’t find a calculator applet that emulated the statistical functions on a standard calculator. So it was really just a part of a bigger applet that made confidence intervals. This function was put in the calculator specifically to allow external access to the calculated value, which when it changed would be transferred to a JTextField on another part of the applet.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.DisplayLabel.setNewExpression().
| OObject jscicalc.ReadOnlyCalculatorApplet.getMemory | ( | ) |
Get the value from memory.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.ExtraPanel.paintComponent().
| AngleType jscicalc.ReadOnlyCalculatorApplet.getAngleType | ( | ) |
Find whether we’re working in degrees or radians.
Trig
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.DisplayLabel.setNewExpression().
| boolean jscicalc.ReadOnlyCalculatorApplet.getStat | ( | ) |
We can emulate a STAT mode and this is how we find out if we’re doing so.
STAT mode switches off some memory functions. I know this isn’t necessary but I want this calculator to emulate some features of a real calculator. You can always put the memory buttons back in if you want.
Implemented in jscicalc.CalculatorApplet.
| int jscicalc.ReadOnlyCalculatorApplet.getMode | ( | ) |
As you’d expect for something emulating a real calculator, we’d better have a mode button.
This one uses integers rather than enumerated types and you get the current mode with this function.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.EntryLabel.update(), and jscicalc.DisplayLabel.update().
| Mean jscicalc.ReadOnlyCalculatorApplet.statMean | ( | ) |
Calculate the mean value.
Implemented in jscicalc.CalculatorApplet.
| Complex jscicalc.ReadOnlyCalculatorApplet.statSumSquares | ( | ) |
Calculate sum of squares - used in standard deviation/variance calculations.
Implemented in jscicalc.CalculatorApplet.
| StDev jscicalc.ReadOnlyCalculatorApplet.statSampleStDev | ( | ) |
Calculate the sample standard deviation.
Implemented in jscicalc.CalculatorApplet.
| PopStDev jscicalc.ReadOnlyCalculatorApplet.statPopulationStDev | ( | ) |
Calculate the population standard deviation.
Implemented in jscicalc.CalculatorApplet.
| javax.swing.JFrame jscicalc.ReadOnlyCalculatorApplet.frame | ( | ) |
Another function whose purpose eludes me.
Implemented in jscicalc.CalculatorApplet.
| Base jscicalc.ReadOnlyCalculatorApplet.getBase | ( | ) |
We work in various bases.
Although numbers are always stored as doubles (i.e. IEE double precision floating point binary representations) so that the Base is essentially just used for formatting and so mainly used by the view, we need to keep a record of base and this is a natural place to keep it, and the Parser object needs to know the base so that it parses numbers entered correctly.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.DisplayLabel.getBase().
| Notation jscicalc.ReadOnlyCalculatorApplet.getNotation | ( | ) |
Get notation (scientific, polar, complex).
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.ExtraPanel.paintComponent(), and jscicalc.DisplayLabel.setNewExpression().
| java.awt.Insets jscicalc.ReadOnlyCalculatorApplet.getFrameInsets | ( | ) |
Get the frame Insets.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.graph.AxisDialog.setSizes().
| int jscicalc.ReadOnlyCalculatorApplet.graphHeight | ( | ) |
| int jscicalc.ReadOnlyCalculatorApplet.getSizesSize | ( | ) |
Find the size of sizes.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.EntryLabel.update().
| int jscicalc.ReadOnlyCalculatorApplet.getMinSize | ( | ) |
Find the minimum size of CalculatorApplet.mSize.
Implemented in jscicalc.CalculatorApplet.
Referenced by jscicalc.EntryLabel.update().
1.5.5