|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.xml.TargetHelper
public class TargetHelper
This class holds all STELLA-near implementations to help other
classes to easily build xml-based TargetDefinitions.
While the
TargetFactory deals with more generic methods, this class
contains all the work needed to construct default merits, constraints,
object and guide star sections as well as necessary setup sections.
This class can be instantiated. Its properties are used to construct
different TelescopeHelpers, which, in turn, provide access to
type-specifiec properties via selecting a proper TypeHelper.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static String |
DEFTELESCOPE
The default telescope properties. |
private static String |
DEFURLRESOURCES
The default path. |
static String |
KEY_DURATION
The duration of the observation. |
static String |
KEY_FILE
The key to the target-xml file name. |
static String |
KEY_TARGETNAME
The key to the object name. |
static String |
KEY_TELESCOPE
The key to the known telescope helper properties. |
private TelescopeHelper |
stella
The telescope helper used. |
private Map |
telescopes
The look-up table linking telescope names to telescope helpers. |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
TargetHelper(Map prop)
Creates a new target helper with the specified properties. |
|
| Method Summary | |
|---|---|
boolean |
addDurationFragment(Map xml)
Adds the duration section as a part of a TargetFactory mapping. |
boolean |
addFileFragment(Map xml)
Adds the file as a part of a TargetFactory mapping. |
boolean |
addTargetNameFragment(Map xml)
Adds the target name as a part of a TargetFactory mapping. |
static ElementHelper |
createElementHelper(Map prop)
Creates a ElementHelper using the provided properties. |
static ObjectHelper |
createObjectHelper(Map prop)
Creates a ElementHelper using the provided properties. |
static TelescopeHelper |
createTelescopeHelper(Map prop)
Creates a TelescopeHelper using the provided properties. |
static TypeHelper |
createTypeHelper(Map prop)
Creates a TypeHelper using the provided properties. |
protected void |
error(String warn)
Issues an error message. |
double |
getDuration()
Returns the duration as a double. |
String |
getFile()
Returns the target name. |
Map |
getKnownTelescopes()
Returns all known telescope as a mapping of telescope names to telescope helpers. |
String |
getTargetName()
Returns the target name. |
TelescopeHelper |
getTelescopeHelper()
Returns the telescope helper in use. |
protected void |
info(String warn)
Issues an info message. |
void |
init()
Initlaizes the TelescopeHelpers known. |
private static Object |
instantiate(String cname,
Map prop)
Searches the properties for the class entry. |
Document |
makeTarget()
Sums up all information and constructs a new DOM target. |
boolean |
selectTelescope(String name)
Select the telescope helper to use. |
void |
setDuration(double dur)
Sets the duration. |
void |
setFile(String target)
Sets the xml-file. |
void |
setTargetName(String target)
Sets the target name. |
protected void |
warn(String warn)
Issues a warning message. |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
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, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, 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, stringProperties |
| Field Detail |
|---|
public static final String KEY_TELESCOPE
public static final String KEY_TARGETNAME
public static final String KEY_FILE
public static final String KEY_DURATION
private static final String DEFURLRESOURCES
private static final String DEFTELESCOPE
private Map telescopes
private TelescopeHelper stella
| Constructor Detail |
|---|
public TargetHelper(Map prop)
| Method Detail |
|---|
public void init()
TelescopeHelpers known.
init in interface Initializableinit in class PropertyResourcespublic Map getKnownTelescopes()
public boolean selectTelescope(String name)
public TelescopeHelper getTelescopeHelper()
public void setTargetName(String target)
ObjectHelper.resolveObjectName(java.lang.String) method, though it might take
the same argument.
public String getTargetName()
public void setFile(String target)
public String getFile()
public double getDuration()
public void setDuration(double dur)
public boolean addTargetNameFragment(Map xml)
TargetFactory mapping.
If target name was not set, a warning is issued.
public boolean addFileFragment(Map xml)
TargetFactory mapping.
If the file-name is
missing it is constructed from the target name, if the latter one is
missing, a warning is issued.
public boolean addDurationFragment(Map xml)
TargetFactory mapping.
public Document makeTarget()
TargetFactory to first create all neccessarry
target fragment and then convert it into an DOM object.
protected void error(String warn)
protected void warn(String warn)
protected void info(String warn)
public static TelescopeHelper createTelescopeHelper(Map prop)
TelescopeHelper using the provided properties. If the
properties do not contain a PropertySupplying.KEY_CLASS property
the standard TelescopeHelper class is used. If one wants
to create daughter classes of the TelescopeHelper, e.g. to
provide GUI-enhanced functionality, the properties should contain
a class entry of this telescope helper subclass.
public static TypeHelper createTypeHelper(Map prop)
TypeHelper using the provided properties. If the
properties do not contain a PropertySupplying.KEY_CLASS property
the standard TypeHelper class is used. If one wants
to create daughter classes of the TypeHelper, e.g. to
provide GUI-enhanced functionality, the properties should contain
a class entry of this telescope helper subclass.
public static ElementHelper createElementHelper(Map prop)
ElementHelper using the provided properties. If the
properties do not contain a PropertySupplying.KEY_CLASS property
the standard ElementHelper class is used. If one wants
to create daughter classes of the ElementHelper, e.g. to
provide GUI-enhanced functionality, the properties should contain
a class entry of this telescope helper subclass.
public static ObjectHelper createObjectHelper(Map prop)
ElementHelper using the provided properties. If the
properties do not contain a PropertySupplying.KEY_CLASS property
the standard ElementHelper class is used. If one wants
to create daughter classes of the ElementHelper, e.g. to
provide GUI-enhanced functionality, the properties should contain
a class entry of this telescope helper subclass.
private static final Object instantiate(String cname,
Map prop)
Initializable
interface, its Initializable.init() method is called.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||