jscicalc.DisplayLabel Class Reference

This is the part of the DisplayPanel that shows the output of calculations. More...

Inheritance diagram for jscicalc.DisplayLabel:

jscicalc.ScrollableLabel
Collaboration diagram for jscicalc.DisplayLabel:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

This is the part of the DisplayPanel that shows the output of calculations.

Author:
J. D. Lamb
Version:
Revision
1.11

Constructor & Destructor Documentation

jscicalc.DisplayLabel.DisplayLabel ( ReadOnlyDisplayPanel  panel  ) 

Constructor.

The object constructed should can read but not modify the DisplayPanel.

Parameters:
panel The panel containing this

References jscicalc.DisplayLabel.clearDisplay, jscicalc.DisplayLabel.displayCaret, jscicalc.DisplayLabel.scrollData, jscicalc.DisplayLabel.setNewExpression(), and jscicalc.ScrollableLabel.textPane.


Member Function Documentation

void jscicalc.DisplayLabel.setNewExpression (  ) 

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.

Parameters:
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.

Parameters:
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.

Parameters:
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 (  ) 

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.

Returns:
The Base of the DisplayFormat object.

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.

Returns:
A number representing the number of digits in the display

References jscicalc.DisplayLabel.DIGITS.

Referenced by jscicalc.DisplayLabel.setNewExpression().

void jscicalc.DisplayLabel.left (  ) 

Scroll left if possible.

See also:
LeftButton

Navigator

Reimplemented from jscicalc.ScrollableLabel.

References jscicalc.DisplayLabel.ScrollData.left(), and jscicalc.DisplayLabel.scrollData.

void jscicalc.DisplayLabel.right (  ) 

Scroll right if possible.

See also:
RightButton

Navigator

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.

Returns:
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().


Member Data Documentation

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]

Used to set number of digits in display.

Referenced by jscicalc.DisplayLabel.getDigits().

final String jscicalc.DisplayLabel.start [static, private]

Initial value:

 "<sub>&nbsp;</sub>&nbsp;<sup>&nbsp;</sup>&nbsp;&nbsp;&nbsp;" 
        + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"

Referenced by jscicalc.DisplayLabel.clear(), and jscicalc.DisplayLabel.setExpression().

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

Reimplemented from jscicalc.ScrollableLabel.


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

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