public class TargetDistance extends AbstractTargetValue implements ParameterDepending, Reloadable
TargetDependingParameter, allowing proper calculation of the
current target distance to i.e. the moon.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private Value |
de
The declination of the first point.
|
static String |
DEFNAME
The name of this global (ra).
|
private static DecimalFormat |
df
The formatter for the distance.
|
private Double |
dist
The current distance after a star has been registered.
|
static String |
KEY_DEC
The name of the parameter that gives the dec of the first point.
|
static String |
KEY_RA
The name of the parameter that gives the ra of the first point.
|
static Map<String,String> |
MOONDISTANCE
Use this properties for distance of target to moon.
|
private Value |
ra
The right ascension of the first point.
|
static Map<String,String> |
SOLDISTANCE
Use this properties for distance of target to sun.
|
KEY_INDEXKEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
TargetDistance(Map<String,String> prop)
Constructs a new global representing the actual object distance
to some other point in the sky.
|
| Modifier and Type | Method and Description |
|---|---|
private Double |
getDistance(double radeg,
double dedeg)
If a point in the sky has been registered, this method returns the
distance to this point from the ra and dec in degrees.
|
Number |
getForTarget(TargetDefinition star)
Gets the declination of the target star.
|
Number |
getValue()
Returns the ra of the actual target.
|
void |
registerParameter(Parameter what)
Registers the parameters giving the ra, dec of two points.
|
void |
registerTarget(TargetDefinition star)
Registers a star to this parameter.
|
double |
rescanned(String key,
String old,
String newval)
As any parameter depending instance we fail if the parameter we depend
on is now a different one.
|
Number |
setValue(Number val)
Sets the distance.
|
get, setgetAsStar, getConstant, getFormattedFor, getSetupcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, overrideDefaultName, register, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreloadgetFormattedForgetFormatted, getName, getStringdefaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringPropertiesinitpublic static final Map<String,String> MOONDISTANCE
public static final Map<String,String> SOLDISTANCE
public static final String KEY_RA
public static final String KEY_DEC
public static final String DEFNAME
private static final DecimalFormat df
private Value ra
private Value de
private Double dist
public double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class AbstractParameterpublic void registerParameter(Parameter what)
registerParameter in interface ParameterDependingpublic void registerTarget(TargetDefinition star)
registerTarget in interface TargetDependingpublic Number getForTarget(TargetDefinition star)
getForTarget in interface TargetDependingParametergetForTarget in interface TargetDependingValuepublic Number getValue()
private Double getDistance(double radeg, double dedeg)
public Number setValue(Number val) throws UnsupportedOperationException
setValue in interface ValueUnsupportedOperationException