jscicalc.ReadOnlyCalculatorApplet Interface Reference

This is an interface for CalculatorApplet that allows us to access only the functions of CalculatorApplet designed to read its state. More...

Inheritance diagram for jscicalc.ReadOnlyCalculatorApplet:

jscicalc.CalculatorApplet

List of all members.

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.


Detailed Description

This is an interface for CalculatorApplet that allows us to access only the functions of CalculatorApplet designed to read its state.

It’s rather like using a pointer to const class in C++ to restrict to const members, but Java doesn’t have const members.

Author:
J. D. Lamb
Version:
Revision
1.8

Member Function Documentation

DisplayPanel jscicalc.ReadOnlyCalculatorApplet.displayPanel (  ) 

Designed so that CalculatorPanel and its subclasses can use the displayPanel object as required.

Returns:
The displayPanel

Implemented in jscicalc.CalculatorApplet.

int jscicalc.ReadOnlyCalculatorApplet.displayHeight ( int  minSize  ) 

Find the display height at minSize.

Parameters:
minSize The minimum size used in the display
Returns:
The display height at minSize

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.DisplayPanel.setUp().

int jscicalc.ReadOnlyCalculatorApplet.buttonHeight ( int  minSize  ) 

Find the button height at minSize.

Parameters:
minSize The minimum size used in the display
Returns:
The button height at minSize

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.graph.AxisDialog.setSizes().

int jscicalc.ReadOnlyCalculatorApplet.buttonWidth ( int  minSize  ) 

Find the button width at minSize.

Parameters:
minSize The minimum size used in the display
Returns:
The button width at minSize

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.

Parameters:
minSize The minimum size used in the display
Returns:
The strut size at minSize

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.

Returns:
Desired height of DisplayPanel in pixels.
See also:
DisplayPanel

Implemented in jscicalc.CalculatorApplet.

int jscicalc.ReadOnlyCalculatorApplet.buttonHeight (  ) 

The height of a standard button.

Used by CalculatorPanel objects.

Returns:
Desired height of a standard button.
See also:
CalculatorButton

Implemented in jscicalc.CalculatorApplet.

int jscicalc.ReadOnlyCalculatorApplet.buttonWidth (  ) 

The width of a standard button.

Used by CalculatorPanel objects.

Returns:
Desired width of a standard button.
See also:
CalculatorButton

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.

Returns:
Desired size of button-group separation
See also:
CalculatorPanel

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.

Returns:
Desired size of button-group separation
See also:
CalculatorPanel

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.

Returns:
Desired fontsize for 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.

Returns:
Desired fontsize for the EntryLabel object.
See also:
EntryLabel

DisplayPanel

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’.

Returns:
Desired fontsize for calculator display
See also:
DisplayPanel

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

Returns:
Desired fontsize for small text
See also:
DisplayPanel

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.

Returns:
true or false according as the calculator is on or off

Implemented in jscicalc.CalculatorApplet.

boolean jscicalc.ReadOnlyCalculatorApplet.getShift (  ) 

Tells us if the shift button is down.

Returns:
true or false according as the shift button is down or up

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.

Returns:
The Parser object

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.

Returns:
The value, which should be a Double
See also:
Parser

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.DisplayLabel.setNewExpression().

OObject jscicalc.ReadOnlyCalculatorApplet.getMemory (  ) 

Get the value from memory.

Returns:
The memory value, zero if nothing has been stored.

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.ExtraPanel.paintComponent().

AngleType jscicalc.ReadOnlyCalculatorApplet.getAngleType (  ) 

Find whether we’re working in degrees or radians.

Returns:
AngleType.DEGREES or AngleType.RADIANS
See also:
AngleType

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.

Returns:
true for stat mode, false for normal mode.
See also:
CalculatorApplet.setStat( boolean )

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.

Returns:
The mode (currently 1, 2 or 3 or maybe 4)

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.EntryLabel.update(), and jscicalc.DisplayLabel.update().

Mean jscicalc.ReadOnlyCalculatorApplet.statMean (  ) 

Calculate the mean value.

Returns:
The mean value
See also:
Mean

Implemented in jscicalc.CalculatorApplet.

Complex jscicalc.ReadOnlyCalculatorApplet.statSumSquares (  ) 

Calculate sum of squares - used in standard deviation/variance calculations.

Returns:
sum of squares of statistical memory values

Implemented in jscicalc.CalculatorApplet.

StDev jscicalc.ReadOnlyCalculatorApplet.statSampleStDev (  ) 

Calculate the sample standard deviation.

Returns:
The sample standard deviation value
See also:
StDev

Implemented in jscicalc.CalculatorApplet.

PopStDev jscicalc.ReadOnlyCalculatorApplet.statPopulationStDev (  ) 

Calculate the population standard deviation.

Returns:
The population standard deviation value
See also:
PopStDev

Implemented in jscicalc.CalculatorApplet.

javax.swing.JFrame jscicalc.ReadOnlyCalculatorApplet.frame (  ) 

Another function whose purpose eludes me.

Returns:
The frame used to hold the calculator

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.

Returns:
The base (default is Base.DECIMAL)

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.DisplayLabel.getBase().

Notation jscicalc.ReadOnlyCalculatorApplet.getNotation (  ) 

Get notation (scientific, polar, complex).

Returns:
the notation.

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.ExtraPanel.paintComponent(), and jscicalc.DisplayLabel.setNewExpression().

java.awt.Insets jscicalc.ReadOnlyCalculatorApplet.getFrameInsets (  ) 

Get the frame Insets.

Returns:
frame Insets

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.graph.AxisDialog.setSizes().

int jscicalc.ReadOnlyCalculatorApplet.graphHeight (  ) 

Get height for Graph.

Returns:
A height

Implemented in jscicalc.CalculatorApplet.

int jscicalc.ReadOnlyCalculatorApplet.getSizesSize (  ) 

Find the size of sizes.

Returns:
The size of sizes

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.EntryLabel.update().

int jscicalc.ReadOnlyCalculatorApplet.getMinSize (  ) 

Find the minimum size of CalculatorApplet.mSize.

Returns:
the minimum size of CalculatorApplet.mSize

Implemented in jscicalc.CalculatorApplet.

Referenced by jscicalc.EntryLabel.update().


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

Generated on Sun Jun 1 08:57:45 2008 for Java Scientific Calculator by  doxygen 1.5.5