

Public Member Functions | |
| DisplayLabel (ReadOnlyDisplayPanel panel) | |
| Constructor. | |
| void | setNewExpression () |
| Set a new expression in the label. | |
| void | update (boolean on) |
| Update the display. | |
| synchronized void | setExpression (OObject o, int m, int precision, Base b, Notation n, double factor) |
| Set a new expression from an OObject. | |
| synchronized void | clear () |
| Clear expression. | |
| Base | getBase () |
| The DisplayFormat object has a Base, which ought to be the same as the CalculatorApplet Base and we use this to get it. | |
| int | getDigits () |
| Get number of digits used. | |
| void | left () |
| Scroll left if possible. | |
| void | right () |
| Scroll right if possible. | |
Static Public Attributes | |
| static final long | BIAS = 1023 |
| Standard constant for IEEE 754 doubles. | |
| static final long | E_MAX = 1023 |
| Standard constant for IEEE 754 doubles. | |
| static final long | E_MIN = -1022 |
| Standard constant for IEEE 754 doubles. | |
Protected Member Functions | |
| void | setCaretVisible (boolean b) |
| Change whether or not the caret should be shown, assuming permission is given. | |
Package Functions | |
| final LeftOrRight | getScrollDirections () |
| Find the directions in which it is possible to scroll. | |
Private Attributes | |
| DisplayCaret | displayCaret |
| Keep a reference to the only Caret. | |
| ScrollData | scrollData |
| Holds data about where the expression is within the Jviewport. | |
| boolean | clearDisplay |
| private use for updating after cleared data | |
Static Private Attributes | |
| static final int | DIGITS = 20 |
| Used to set number of digits in display. | |
| static final String | start |
| static final long | serialVersionUID = 1L |
Classes | |
| class | DisplayCaret |
| This is a local class that implements a default Caret. More... | |
| class | ScrollData |
| This class is used to hold the information required for scrolling left and right. More... | |
| jscicalc.DisplayLabel.DisplayLabel | ( | ReadOnlyDisplayPanel | panel | ) |
Constructor.
The object constructed should can read but not modify the DisplayPanel.
| panel | The panel containing this |
References jscicalc.DisplayLabel.clearDisplay, jscicalc.DisplayLabel.displayCaret, jscicalc.DisplayLabel.scrollData, jscicalc.DisplayLabel.setNewExpression(), and jscicalc.ScrollableLabel.textPane.
| void jscicalc.DisplayLabel.setNewExpression | ( | ) |
Set a new expression in the label.
References jscicalc.DisplayLabel.displayCaret, jscicalc.ReadOnlyCalculatorApplet.getAngleType(), jscicalc.ReadOnlyDisplayPanel.getApplet(), jscicalc.DisplayLabel.getBase(), jscicalc.DisplayLabel.getDigits(), jscicalc.ReadOnlyCalculatorApplet.getNotation(), jscicalc.ReadOnlyCalculatorApplet.getValue(), jscicalc.ScrollableLabel.panel, jscicalc.DisplayLabel.setExpression(), and jscicalc.DisplayLabel.DisplayCaret.updateFlag.
Referenced by jscicalc.DisplayLabel.DisplayLabel(), jscicalc.DisplayPanel.setValue(), and jscicalc.DisplayLabel.update().
| void jscicalc.DisplayLabel.setCaretVisible | ( | boolean | b | ) | [protected] |
Change whether or not the caret should be shown, assuming permission is given.
This overrides base function so that caret is always invisible.
| b | true if caret should be shown; false otherwise |
Reimplemented from jscicalc.ScrollableLabel.
References jscicalc.ScrollableLabel.caretVisible, and jscicalc.ScrollableLabel.updateCaretVisibility().
| void jscicalc.DisplayLabel.update | ( | boolean | on | ) | [virtual] |
Update the display.
The state should depend on whether the calculator is switched on and we ough to read this indirectly rather than pass the state as a parameter.
| on | true if calculator switched on. |
Implements jscicalc.ScrollableLabel.
References jscicalc.DisplayLabel.clear(), jscicalc.DisplayLabel.clearDisplay, jscicalc.DisplayLabel.displayCaret, jscicalc.ScrollableLabel.dotPosition, jscicalc.ScrollableLabel.expression, jscicalc.ReadOnlyDisplayPanel.getApplet(), jscicalc.ReadOnlyCalculatorApplet.getMode(), jscicalc.ScrollableLabel.panel, jscicalc.DisplayLabel.setNewExpression(), and jscicalc.ScrollableLabel.textPane.
Referenced by jscicalc.DisplayPanel.update().
| synchronized void jscicalc.DisplayLabel.setExpression | ( | OObject | o, | |
| int | m, | |||
| int | precision, | |||
| Base | b, | |||
| Notation | n, | |||
| double | factor | |||
| ) |
Set a new expression from an OObject.
| o | The OObject to be displayed | |
| m | The number of digits (used by Complex) | |
| precision | The precision (used by Complex) | |
| b | The Base for numbers | |
| n | The Notation for numbers | |
| factor | Not currently used |
References jscicalc.ReadOnlyCalculatorApplet.displayTextSize(), jscicalc.ScrollableLabel.dotPosition, jscicalc.Navigator.dots, jscicalc.ScrollableLabel.expression, jscicalc.ReadOnlyDisplayPanel.getApplet(), jscicalc.ScrollableLabel.navigator, jscicalc.ScrollableLabel.panel, jscicalc.DisplayLabel.start, and jscicalc.OObject.toHTMLStringVector().
Referenced by jscicalc.DisplayLabel.setNewExpression().
| synchronized void jscicalc.DisplayLabel.clear | ( | ) |
Clear expression.
Useful in response to OnButton, for example.
References jscicalc.DisplayLabel.clearDisplay, jscicalc.ScrollableLabel.dotPosition, jscicalc.ScrollableLabel.expression, and jscicalc.DisplayLabel.start.
Referenced by jscicalc.DisplayLabel.update().
| Base jscicalc.DisplayLabel.getBase | ( | ) |
The DisplayFormat object has a Base, which ought to be the same as the CalculatorApplet Base and we use this to get it.
References jscicalc.ReadOnlyDisplayPanel.getApplet(), jscicalc.ReadOnlyCalculatorApplet.getBase(), and jscicalc.ScrollableLabel.panel.
Referenced by jscicalc.DisplayLabel.setNewExpression().
| int jscicalc.DisplayLabel.getDigits | ( | ) |
Get number of digits used.
I think this is a default number so we don’t overrun the display width.
References jscicalc.DisplayLabel.DIGITS.
Referenced by jscicalc.DisplayLabel.setNewExpression().
| void jscicalc.DisplayLabel.left | ( | ) |
Scroll left if possible.
Reimplemented from jscicalc.ScrollableLabel.
References jscicalc.DisplayLabel.ScrollData.left(), and jscicalc.DisplayLabel.scrollData.
| void jscicalc.DisplayLabel.right | ( | ) |
Scroll right if possible.
Reimplemented from jscicalc.ScrollableLabel.
References jscicalc.DisplayLabel.ScrollData.right(), and jscicalc.DisplayLabel.scrollData.
| final LeftOrRight jscicalc.DisplayLabel.getScrollDirections | ( | ) | [package] |
Find the directions in which it is possible to scroll.
References jscicalc.DisplayLabel.ScrollData.getScrollDirections(), and jscicalc.DisplayLabel.scrollData.
Referenced by jscicalc.DisplayPanel.displayLabelScrollable(), and jscicalc.DisplayPanel.update().
Keep a reference to the only Caret.
Referenced by jscicalc.DisplayLabel.DisplayLabel(), jscicalc.DisplayLabel.setNewExpression(), and jscicalc.DisplayLabel.update().
ScrollData jscicalc.DisplayLabel.scrollData [private] |
Holds data about where the expression is within the Jviewport.
Referenced by jscicalc.DisplayLabel.DisplayLabel(), jscicalc.DisplayLabel.getScrollDirections(), jscicalc.DisplayLabel.left(), and jscicalc.DisplayLabel.right().
boolean jscicalc.DisplayLabel.clearDisplay [private] |
private use for updating after cleared data
Referenced by jscicalc.DisplayLabel.clear(), jscicalc.DisplayLabel.DisplayLabel(), and jscicalc.DisplayLabel.update().
final long jscicalc.DisplayLabel.BIAS = 1023 [static] |
Standard constant for IEEE 754 doubles.
final long jscicalc.DisplayLabel.E_MAX = 1023 [static] |
Standard constant for IEEE 754 doubles.
final long jscicalc.DisplayLabel.E_MIN = -1022 [static] |
Standard constant for IEEE 754 doubles.
final int jscicalc.DisplayLabel.DIGITS = 20 [static, private] |
final String jscicalc.DisplayLabel.start [static, private] |
Initial value:
"<sub> </sub> <sup> </sup> " + " " + " " + " " + " "
Referenced by jscicalc.DisplayLabel.clear(), and jscicalc.DisplayLabel.setExpression().
final long jscicalc.DisplayLabel.serialVersionUID = 1L [static, private] |
Reimplemented from jscicalc.ScrollableLabel.
1.5.5