|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.lehmannet.om.SchemaElement
de.lehmannet.om.Scope
public class Scope
A Scope describes an optical instrument which can be
used for astronomical observations.
A Scope must have an aperture and a model name, as well
as either a magnification or a focalLength.
(magnification should be set if the optical instrument
does not allow to change eyepieces).
| Field Summary |
|---|
| Fields inherited from interface de.lehmannet.om.ISchemaElement |
|---|
XML_ELEMENT_ATTRIBUTE_ID |
| Constructor Summary | |
|---|---|
Scope(float aperture,
float magnification,
java.lang.String model)
Constructs a new instance of a Scope. |
|
Scope(org.w3c.dom.Node scope)
Constructs a new instance of a Scope from a given XML Schmea Node. |
|
Scope(java.lang.String model,
float aperture,
float focalLength)
Constructs a new instance of a Scope. |
|
| Method Summary | |
|---|---|
org.w3c.dom.Element |
addAsLinkToXmlElement(org.w3c.dom.Element element)
Adds the scope link to an given XML DOM Element The scope element itself will be attached to given elements ownerDocument. |
org.w3c.dom.Element |
addToXmlElement(org.w3c.dom.Element element)
Adds this Scope to a given parent XML DOM Element. |
float |
getAperture()
Returns the aperture of the scope. |
java.lang.String |
getDisplayName()
Returns a display name for this element. |
float |
getFocalLength()
Returns the focal length of the scope. |
float |
getLightGrasp()
Returns the light grasp value of the scope. |
float |
getMagnification()
Returns the magnification of the scope. |
java.lang.String |
getModel()
Returns the scopes model name. |
Angle |
getTrueFieldOfView()
Returns the true field of view, if set. |
java.lang.String |
getType()
Returns the scope type. |
java.lang.String |
getVendor()
Returns the scope's vendor name. |
boolean |
isOrientationErected()
Returns the scopes picture vertical orientation. |
boolean |
isOrientationTruesided()
Returns the scopes picture horizontal orientation. |
void |
setAperture(float aperture)
Sets the aperture of the scope. |
void |
setFocalLength(float focalLength)
Sets the focal length of the scope. |
boolean |
setLightGrasp(float lightGrasp)
Sets the light grasp value of the scope. |
void |
setMagnification(float magnification)
Sets the magnification of the scope. |
void |
setModel(java.lang.String model)
Sets the model name of the scope. |
void |
setOrientation(boolean errected,
boolean truesided)
Sets the orientation of the scope. |
void |
setTrueFieldOfView(Angle tfov)
Sets the true field of view, if magnification is given. |
void |
setType(java.lang.String type)
Sets the type of the scope. |
void |
setVendor(java.lang.String vendor)
Sets the vendor name of the scope. |
java.lang.String |
toString()
Overwrittes toString() method from java.lang.Object. |
| Methods inherited from class de.lehmannet.om.SchemaElement |
|---|
equals, getID, setID |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.lehmannet.om.ISchemaElement |
|---|
getID |
| Constructor Detail |
|---|
public Scope(org.w3c.dom.Node scope)
throws SchemaException,
java.lang.IllegalArgumentException
scope - The XML Schema Node that represents this Scope
Object
java.lang.IllegalArgumentException - if the parameter is SchemaException - if the given Node does not match the
XML Schema secifications
public Scope(java.lang.String model,
float aperture,
float focalLength)
throws java.lang.IllegalArgumentException
model - The scopes model nameaperture - The aperture of the scopefocalLength - The focal length of the scope
java.lang.IllegalArgumentException - if one of the parameters
has an illegal value (see setModel(String), setAperture(float)
and setFocalLength(float) for allowed values
public Scope(float aperture,
float magnification,
java.lang.String model)
throws java.lang.IllegalArgumentException
aperture - The scopes aperturemagnification - The magnification of the scopemodel - The model name of the scope
java.lang.IllegalArgumentException - if one of the parameters
has an illegal value (see setModel(String), setAperture(float)
and setMagnification(float) for allowed values| Method Detail |
|---|
public java.lang.String getDisplayName()
getDisplayName in interface ISchemaElementgetDisplayName in class SchemaElementjava.lang.Object.toString();public java.lang.String toString()
toString in class java.lang.ObjectObjectpublic org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
addToXmlElement in interface IScopeparent - The parent element for this Scope
null if parent was null.Elementpublic org.w3c.dom.Element addAsLinkToXmlElement(org.w3c.dom.Element element)
addAsLinkToXmlElement in interface IScopeelement - The element under which the the scope link is created
null if element was null.Elementpublic float getAperture()
getAperture in interface IScopepublic float getFocalLength()
Float.NaN
in case the focal length is not set for this
scope. In that case the magnification
must return a value.
getFocalLength in interface IScopepublic float getLightGrasp()
Float.NaN
in case the light grasp was never set.
getLightGrasp in interface IScopepublic Angle getTrueFieldOfView()
NULL as the field is optional only if
magnification is set.
getTrueFieldOfView in interface IScopeNULL if the value was never set.
public boolean isOrientationErected()
throws java.lang.IllegalStateException
isOrientationErected in interface IScopejava.lang.IllegalStateException - if orientation was not set by the user,
so the class cannot return true or false
public boolean isOrientationTruesided()
throws java.lang.IllegalStateException
isOrientationTruesided in interface IScopejava.lang.IllegalStateException - if orientation was not set by the user,
so the class cannot return true or falsepublic float getMagnification()
Float.NaN
in case the magnification is not set for this
scope. In that case the focal length
must return a value.
getMagnification in interface IScopepublic java.lang.String getModel()
getModel in interface IScopepublic java.lang.String getType()
null
if the type was never set.
getType in interface IScopenull
if the type was never set.public java.lang.String getVendor()
null
if the vendor was never set.
getVendor in interface IScopenull if the type was never set.
public void setAperture(float aperture)
throws java.lang.IllegalArgumentException
setAperture in interface IScopeaperture - The new aperture of the scope
java.lang.IllegalArgumentException - if the given aperture
is smaller or equal 0.0 or if the aperture is Float.NaN
public void setFocalLength(float focalLength)
throws java.lang.IllegalArgumentException
setFocalLength in interface IScopefocalLength - The new focal length of the scope
java.lang.IllegalArgumentException - if the given focal length
is smaller or equal 0.0 or if the new focal length is Float.NaN
while magnification is also Float.NaN. Or magnification is already set.public boolean setLightGrasp(float lightGrasp)
setLightGrasp in interface IScopelightGrasp - The new light grasp value of the scope
public void setMagnification(float magnification)
throws java.lang.IllegalArgumentException
setMagnification in interface IScopemagnification - The new magnification value of the scope
java.lang.IllegalArgumentException - if the given focal length
is Float.NaN while focal length is not set. Or focal length is
already set.
public void setTrueFieldOfView(Angle tfov)
throws java.lang.IllegalArgumentException
setTrueFieldOfView in interface IScopetfov - The true field of view of the scope
java.lang.IllegalArgumentException - if focal length is set.
public void setModel(java.lang.String model)
throws java.lang.IllegalArgumentException
null.
setModel in interface IScopemodel - The new model name of the scope
java.lang.IllegalArgumentException - if the given model name
is nullpublic void setType(java.lang.String type)
setType in interface IScopetype - The new type of the scopepublic void setVendor(java.lang.String vendor)
setVendor in interface IScopevendor - The new vendor name of the scope
public void setOrientation(boolean errected,
boolean truesided)
setOrientation in interface IScopeerrected - true if the scope produces errected picturestruesided - true if the scope produces truesided pictures
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||