|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
kiwi.ui.DataField | +--kiwi.ui.NumericField
A concrete subclass of DataField
for the input and display of
specialized data values, such as currency amounts, percentages, and decimal
values.
Inner classes inherited from class kiwi.ui.DataField |
DataField._DocumentListener |
Field Summary | |
private int |
decimals
|
private boolean |
grouping
|
private boolean |
hasMaxValue
|
private boolean |
hasMinValue
|
private static LocaleManager |
lm
|
private double |
maxValue
|
private double |
minValue
|
private int |
type
|
private double |
value
|
Fields inherited from class kiwi.ui.DataField |
adjusting, csupport, documentListener, inputRequired, invalid |
Constructor Summary | |
NumericField(int width)
Construct a new NumericField of the specified width and
a default type of DECIMAL_FORMAT . |
|
NumericField(int width,
int type)
Construct a new NumericField of the specified width, for the
specified value type. |
Method Summary | |
protected boolean |
checkInput()
Validate the input in this field. |
void |
clearMaxValue()
Clear the maximum value constraint. |
void |
clearMinValue()
Clear the minimum value constraint. |
int |
getDecimals()
Get the number of decimals being displayed to the right of the radix. |
boolean |
getGrouping()
Get the grouping mode fo rthis numeric field. |
int |
getType()
Get the validation type for this field. |
double |
getValue()
Get the value from the field. |
void |
setDecimals(int decimals)
Set the number of decimals to display to the right of the radix. |
void |
setGrouping(boolean grouping)
Set the grouping mode for this numeric field. |
void |
setMaxValue(double value)
Set a maximum value constraint. |
void |
setMinValue(double value)
Set a minimum value constraint. |
void |
setType(int type)
Set the validation type for this field. |
void |
setValue(double value)
Set the numeric value to be displayed by this field. |
void |
setValue(float value)
Set the numeric value to be displayed by this field. |
void |
setValue(int value)
Set the numeric value to be displayed by this field. |
void |
setValue(long value)
Set the numeric value to be displayed by this field. |
void |
setValue(short value)
Set the numeric value to be displayed by this field. |
Methods inherited from class kiwi.ui.DataField |
_fireChange, _init, addChangeListener, getMaximumLength, isInputRequired, paintInvalid, removeChangeListener, setDocument, setEditable, setInputRequired, setMaximumLength, setText, validateInput |
Field Detail |
private static LocaleManager lm
private int type
private int decimals
private double value
private double maxValue
private double minValue
private boolean hasMaxValue
private boolean hasMinValue
private boolean grouping
Constructor Detail |
public NumericField(int width)
NumericField
of the specified width and
a default type of DECIMAL_FORMAT
.width
- The width of the field.public NumericField(int width, int type)
NumericField
of the specified width, for the
specified value type.width
- The width of the field.type
- A validation type; one of the format constants defined in the
FormatConstants
class.kiwi.text.FormatConstants
Method Detail |
public void setValue(double value)
value
- The value.public void setValue(float value)
value
- The value. This value is cast internally to a double.public void setValue(int value)
value
- The value. This value is cast internally to a double.public void setValue(long value)
value
- The value. This value is cast internally to a double.public void setValue(short value)
value
- The value. This value is cast internally to a double.public void setType(int type)
type
- A validation type; one of the format constants defined in the
FormatConstants
class.kiwi.text.FormatConstants
public int getType()
public double getValue()
validateInput()
.validateInput()
resulted in a parsing error, or if there was
no previous call to validateInput()
.DataField.validateInput()
protected boolean checkInput()
checkInput
in class DataField
public void setDecimals(int decimals)
decimals
- The new decimal count.public int getDecimals()
public void setMaxValue(double value)
value
- The new maximum value.public void clearMaxValue()
public void setMinValue(double value)
value
- The new minimum value.public void clearMinValue()
public void setGrouping(boolean grouping)
grouping
- A flag specifying whether grouping should be on
(true) or off (false).public boolean getGrouping()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |