|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.config.ConfigKey<Double>
uk.ac.starlink.ttools.plot2.config.DoubleConfigKey
public abstract class DoubleConfigKey
Config key for double precision values. NaN and null are not distinguished.
Static methods are provided to produce config keys with a variety of GUI options for specifying values.
Constructor Summary | |
---|---|
protected |
DoubleConfigKey(ConfigMeta meta,
double dflt)
Constructor. |
Method Summary | |
---|---|
static DoubleConfigKey |
createSliderKey(ConfigMeta meta,
double dflt,
double lo,
double hi,
boolean log)
Returns a key with a linear or logarithmic slider for a specifier. |
static DoubleConfigKey |
createTextKey(ConfigMeta meta)
Constructs a key with a text field specifier and default NaN. |
static DoubleConfigKey |
createTextKey(ConfigMeta meta,
double dflt)
Constructs a key with a text field specifier and an explicit default. |
static DoubleConfigKey |
createToggleKey(ConfigMeta meta,
double fval,
double tval)
Returns a key with a specifier that only provides a toggle between two values. |
Double |
stringToValue(String txt)
Decodes a string value to the value type of this key. |
String |
valueToString(Double value)
Reports a value as a string. |
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey |
---|
cast, createSpecifier, getDefaultValue, getMeta, getValueClass, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected DoubleConfigKey(ConfigMeta meta, double dflt)
meta
- metadatadflt
- default valueMethod Detail |
---|
public String valueToString(Double value)
ConfigKey
stringToValue(valueToString(v)).equals(v)
.
A null value, if permitted, should be represented as an empty string.
valueToString
in class ConfigKey<Double>
value
- possible value associated with this key
public Double stringToValue(String txt) throws ConfigException
ConfigKey
stringToValue
in class ConfigKey<Double>
txt
- string representation of value
ConfigException
public static DoubleConfigKey createTextKey(ConfigMeta meta)
meta
- metadata
public static DoubleConfigKey createTextKey(ConfigMeta meta, double dflt)
meta
- metadatadflt
- default value
public static DoubleConfigKey createToggleKey(ConfigMeta meta, double fval, double tval)
meta
- metadatafval
- value for toggle false (default)tval
- value for toggle true
public static DoubleConfigKey createSliderKey(ConfigMeta meta, double dflt, double lo, double hi, boolean log)
meta
- metadatadflt
- default valuelo
- slider lower boundhi
- slider upper boundlog
- true for logarithmic slider scale, false for linear
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |