jscicalc.EntryLabel Class Reference

This is the component that shows the entry we are typing. More...

Inheritance diagram for jscicalc.EntryLabel:

jscicalc.ScrollableLabel
Collaboration diagram for jscicalc.EntryLabel:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 EntryLabel (ReadOnlyDisplayPanel panel)
 The constructor defines an interface to the DisplayPanel object.
void update (boolean on)
 Update the display.
javax.swing.Action backward ()
 Not used.
synchronized void delete (Parser parser)
 Delete element to left of Caret (if possible).
synchronized void setExpression (Parser parser)
 Set a new expression from the Parser.
synchronized void clear (Parser parser)
 Clear expression.
synchronized void insert (PObject p, Parser parser)
 Insert element to right of Caret (if possible).

Static Private Attributes

static final String endhtml
 This pads out the expression and makes it a bit taller if necessary so that new expressions are left-adjusted.
static final long serialVersionUID = 1L


Detailed Description

This is the component that shows the entry we are typing.

For various reasons it takes quite a lot of setting up. We want it to be editable and show HTML output (so, for example, that we can get square root or exponent signs). So we use a JTextPane. But we also want it to be a single line and scrollable; so we encapsulate it in a JViewPort. Finally we want to make sure we only scroll to valid positions (between PObject strings) so we add a NavigationFilter called Navigator. We also need a JPanel just to hold everything together.

Author:
J. D. Lamb
Version:
Revision
1.10

Constructor & Destructor Documentation

jscicalc.EntryLabel.EntryLabel ( ReadOnlyDisplayPanel  panel  ) 

The constructor defines an interface to the DisplayPanel object.

Parameters:
panel The display panel (we read values from CalculatorApplet through it)


Member Function Documentation

void jscicalc.EntryLabel.update ( boolean  on  )  [virtual]

javax.swing.Action jscicalc.EntryLabel.backward (  ) 

Not used.

I tried allowing the CalculatorButton to fire an Action to move the Caret left, but it didn’t work

Returns:
The Action (mmove left)

Referenced by jscicalc.DisplayPanel.backward().

synchronized void jscicalc.EntryLabel.delete ( Parser  parser  ) 

synchronized void jscicalc.EntryLabel.setExpression ( Parser  parser  ) 

synchronized void jscicalc.EntryLabel.clear ( Parser  parser  ) 

Clear expression.

Useful in response to OnButton, for example.

Parameters:
parser The Parser: we must also clear expression in the Parser

References jscicalc.Parser.clearExpression(), jscicalc.ScrollableLabel.dotPosition, and jscicalc.ScrollableLabel.expression.

Referenced by jscicalc.DisplayPanel.clear().

synchronized void jscicalc.EntryLabel.insert ( PObject  p,
Parser  parser 
)


Member Data Documentation

final String jscicalc.EntryLabel.endhtml [static, private]

Initial value:

 "<sup> </sup><sub>&nbsp;<sub>&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;&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;&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;"
        + "&nbsp;&nbsp;&nbsp;&nbsp;<sup> </sup><sub>&nbsp;</sub></p></html>"
This pads out the expression and makes it a bit taller if necessary so that new expressions are left-adjusted.

Otherwise the display would start in the middle of the JViewPort. Navigator makes sure we can never try to edit this invisible region.

Referenced by jscicalc.EntryLabel.update().

final long jscicalc.EntryLabel.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:41 2008 for Java Scientific Calculator by  doxygen 1.5.5