|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
com.numobjects.mathbeans.awt.CalcField
Class CalcField (Calculator enabled field bean) provides the following functionality: it is a text field in which the user can enter any constant mathematical expression and press Enter. If the syntax of the expression is correct, it gets computed and displayed in the same field. The user can set parameters that control the format of the output. The field has an optional cyclic history buffer controlled by up/down keys.
An example of a constant expression is e.g.
18562*113-34/3
or
0.5 - sin (PI/3) + exp (sqrt(3.654))
An expression like
sin(x)
or
t+1
or
y=2+2
is NOT constant since it contains variables. See Expression syntax and available functions for a full description of syntax, available functions and procedures.
CalcPanel,
CalcGraphPanel, Serialized Form| Constructor Summary | |
CalcField()
Constructs a new CalcField |
|
CalcField(java.lang.String text)
Constructs a new CalcField |
|
| Method Summary | |
void |
error()
Sets error |
int |
getBufferSize()
Gets expression history buffer size |
int |
getPrecision()
Gets precision |
int |
getRounding()
Gets rounding |
java.lang.String |
getValue(boolean translate)
Gets value |
void |
setBufferSize(int bufferSize)
Sets expression history buffer size; range >= 0, default value 6, 0 means expressions not memorized |
void |
setPrecision(int value)
Sets precision (the number of significant digits in the calculation); range 1 - 15, default precision is 6 |
void |
setRounding(int value)
Sets rounding (the number of digits displayed after the decimal dot); range -1 - 15, default rounding is -1 (no rounding) |
void |
setValue(java.lang.String value,
boolean translate)
Sets value |
| Constructor Detail |
public CalcField()
public CalcField(java.lang.String text)
initial - text| Method Detail |
public void setPrecision(int value)
value - precision to setpublic int getPrecision()
public void setRounding(int value)
value - roundingpublic int getRounding()
public void setBufferSize(int bufferSize)
bufferSize - buffer size to setpublic int getBufferSize()
public void error()
public java.lang.String getValue(boolean translate)
translate - translation flag
public void setValue(java.lang.String value,
boolean translate)
value - value stringtranslate - translation flag
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||