|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.vo.DoubleValueField
public class DoubleValueField
Generalised data entry field which can hold a double precision number.
As well as a text entry field, this also contains an option for choosing
the format in which the data will be entered.
The format options are defined by an array of ValueConverter
objects supplied at construction time.
Constructor Summary | |
---|---|
DoubleValueField(String name,
ValueConverter[] convs)
Constructs a value field given its name. |
|
DoubleValueField(ValueInfo info,
ValueConverter[] convs)
Constructs a value field given a ValueInfo object. |
Method Summary | |
---|---|
JComboBox |
getConverterSelector()
Returns the combo box used to select the entry format used by this field. |
DescribedValue |
getDescribedValue()
Returns a described value object (metadata+data) which describes the value currently held by this field. |
JTextField |
getEntryField()
Returns this field's text entry component. |
JLabel |
getLabel()
Returns this field's label componnent. |
double |
getValue()
Returns the numeric value which the user has entered. |
DefaultValueInfo |
getValueInfo()
Returns the ValueInfo object which describes the data in this field. |
static DoubleValueField |
makeDecDegreesField()
Returns an instance suitable for entering Declination for which getValue() returns degrees. |
static DoubleValueField |
makeRADegreesField()
Returns an instance suitable for entering Right Ascension, for which getValue() returns degrees. |
static DoubleValueField |
makeSizeDegreesField(ValueInfo info)
Returns an instance suitable for entering an angular size, for which getValue() returns degrees. |
void |
setDescription(String description)
Sets the description of this field. |
void |
setEnabled(boolean enabled)
Sets the enabled status of the user-interacting components of this field. |
void |
setValue(double value)
Sets the state of the GUI component controlled by this field. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoubleValueField(String name, ValueConverter[] convs)
name
- field nameconvs
- list of converter objectspublic DoubleValueField(ValueInfo info, ValueConverter[] convs)
info
- field metadataconvs
- list of converter objectsMethod Detail |
---|
public DefaultValueInfo getValueInfo()
public void setDescription(String description)
description
- description of fieldpublic DescribedValue getDescribedValue()
public JLabel getLabel()
public JTextField getEntryField()
public JComboBox getConverterSelector()
public double getValue()
IllegalArgumentException
- if the current contents of the
entry field don't make sense to the current format selectorpublic void setValue(double value)
value
- value to displaypublic void setEnabled(boolean enabled)
enabled
- whether this component is to be enabled or notpublic static DoubleValueField makeRADegreesField()
getValue()
returns degrees.
public static DoubleValueField makeDecDegreesField()
getValue()
returns degrees.
public static DoubleValueField makeSizeDegreesField(ValueInfo info)
getValue()
returns degrees.
info
- description of field content
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |