public class TLcdProcedureTrajectory extends java.lang.Object implements ILcdPolyline,ILcdFeatured, ILcdDataObject, ILcdInvalidateable
ILcdProcedure
, provided
as a convenience to help display procedures on a map. This class implements
ILcdPolyline
, so that it is easy to use it with existing
LuciadLightspeed tools such as vertical views.
A procedure trajectory stores a reference to a procedure, and also holds a
TLcdProcedureGeometryCalculator
and TLcdAircraftPerformanceSettings
.
The combination of these two objects provide a geometrical representation of
the procedure. This geometrical representation is internally cached, so
external changes to the geometry calculator or the aircraft performance settings
should always be accompanied by a call to the invalidate()
method, which will ensure that the procedure geometry is properly updated to
reflect the changes.
To avoid memory problems when handling large sets of procedure trajectories,
the geometrical representation is stored using SoftReference
objects:
this allows to garbage-collect the geometrical representation, when
memory is running low. In order to have the best performance, enough memory
is needed to store all geometrical representations.
To access the geometry of a procedure trajectory, two approaches can be used:
ILcdPolyline
, which give access
to the individual points of the procedure trajectory,ILcdProcedureGeometryHandler
via processProcedureGeometry(ILcdProcedureGeometryHandler)
,
which gives access to high-level information about the geometry that is not
available through the ILcdPolyline
interface.
Users should try to avoid adding ILcdProcedure
objects to an
ILcdModel
directly, and should prefer using this class instead.
Constructor and Description |
---|
TLcdProcedureTrajectory(ILcdProcedure aProcedure,
TLcdAircraftPerformanceSettings aAircraftPerformanceSettings,
TLcdProcedureGeometryCalculator aGeometryCalculator)
Constructs a
TLcdProcedureTrajectory for the given procedure. |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aIndex)
Returns whether the feature at the given index of the associated
ILcdProcedure can be set. |
java.lang.Object |
clone()
Returns a clone of this
TLcdProcedureTrajectory object. |
boolean |
contains2D(double aX,
double aY)
Returns
false . |
boolean |
contains2D(ILcdPoint aPoint)
Returns
false . |
boolean |
contains3D(double aX,
double aY,
double aZ)
Returns
false . |
boolean |
contains3D(ILcdPoint aPoint)
Returns
false . |
TLcdAircraftPerformanceSettings |
getAircraftPerformanceSettings()
Returns the aircraft performance settings used by this trajectory.
|
ILcdBounds |
getBounds()
Returns the bounds of this trajectory.
|
TLcdDataType |
getDataType()
Returns the type of this data object.
|
java.lang.Object |
getFeature(int aIndex)
Returns the feature at the given index of the associated
ILcdProcedure ,
if it is of the type ILcdFeatured . |
int |
getFeatureCount()
Returns the number of features of the associated
ILcdProcedure ,
if it is of the type ILcdFeatured . |
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
ILcdPoint |
getPoint(int aIndex)
Returns the trajectory point at the given index.
|
int |
getPointCount()
Returns the number of points in this trajectory.
|
ILcdProcedure |
getProcedure()
Returns the
ILcdProcedure associated with this trajectory. |
TLcdProcedureGeometryCalculator |
getProcedureGeometryCalculator()
Returns the procedure geometry calculator used to calculate this trajectory.
|
java.lang.Object |
getValue(java.lang.String aPropertyName)
Convenience method that returns the value of the property with the given name.
|
java.lang.Object |
getValue(TLcdDataProperty aProperty)
Returns the value of the given property.
|
boolean |
hasValue(java.lang.String aPropertyName)
Indicates whether this data object has a value for the given property.
|
boolean |
hasValue(TLcdDataProperty aProperty)
Indicates whether this data object has a value for the given property.
|
void |
invalidate()
Discards the geometry cached with this trajectory and recalculates it from
the source procedure.
|
void |
invalidateObject()
Delegates to
invalidate() . |
void |
processProcedureGeometry(ILcdProcedureGeometryHandler aHandler)
Iterates over the procedure geometry using an
ILcdProcedureGeometryHandler . |
void |
setAircraftPerformanceSettings(TLcdAircraftPerformanceSettings aPerformance)
Sets the aircraft performance settings to be used by this trajectory
and invokes the
invalidate() method. |
void |
setFeature(int aIndex,
java.lang.Object aObject)
Sets the feature at the given index of the associated
ILcdProcedure ,
if it is of the type ILcdFeatured . |
void |
setProcedureGeometryCalculator(TLcdProcedureGeometryCalculator aGeometryCalculator)
Sets the procedure geometry calculator to be used to calculate
this trajectory and invokes the
invalidate() method. |
void |
setValue(java.lang.String aPropertyName,
java.lang.Object aValue)
Convenience method that sets the value of the property with the given name.
|
void |
setValue(TLcdDataProperty aProperty,
java.lang.Object aValue)
Sets the value of the given property for this data object.
|
java.lang.String |
toString()
Returns the toString value
of the associated
ILcdProcedure . |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPointSFCT, getX, getY, getZ
public TLcdProcedureTrajectory(ILcdProcedure aProcedure, TLcdAircraftPerformanceSettings aAircraftPerformanceSettings, TLcdProcedureGeometryCalculator aGeometryCalculator)
TLcdProcedureTrajectory
for the given procedure.
The trajectory is built using the given geometry calculator and aircraft performance settings.aProcedure
- A procedure to create a trajectory foraAircraftPerformanceSettings
- The aircraft performance settings to be used to calculate the trajectoryaGeometryCalculator
- The geometry calculator to calculate the trajectorypublic void invalidate()
ILcdModel
containing this trajectory should be notified by means of a call to
ALcdModel.elementChanged(Object, int)
!public void invalidateObject()
invalidate()
.invalidateObject
in interface ILcdInvalidateable
invalidate()
public void processProcedureGeometry(ILcdProcedureGeometryHandler aHandler)
ILcdProcedureGeometryHandler
.
This gives access to high-level information about the geometry that is not
available through the ILcdPolyline
interface.aHandler
- A handler to iterate over the procedure geometrypublic ILcdProcedure getProcedure()
ILcdProcedure
associated with this trajectory.ILcdProcedure
associated with this trajectory.public TLcdAircraftPerformanceSettings getAircraftPerformanceSettings()
invalidate()
must be called on all TLcdProcedureTrajectory
objects
that are using it.public void setAircraftPerformanceSettings(TLcdAircraftPerformanceSettings aPerformance)
invalidate()
method.aPerformance
- the aircraft performance settings to be used by this trajectory.public TLcdProcedureGeometryCalculator getProcedureGeometryCalculator()
invalidate()
must be called on all TLcdProcedureTrajectory
objects
that are using it.public void setProcedureGeometryCalculator(TLcdProcedureGeometryCalculator aGeometryCalculator)
invalidate()
method.aGeometryCalculator
- the procedure geometry calculator to calculate this trajectory.public java.lang.String toString()
ILcdProcedure
.toString
in class java.lang.Object
ILcdProcedure
.public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public boolean contains2D(ILcdPoint aPoint)
false
.contains2D
in interface ILcdShape
aPoint
- a pointfalse
.ILcdShape.contains2D(double, double)
public boolean contains2D(double aX, double aY)
false
.contains2D
in interface ILcdShape
aX
- An X coordinateaY
- An Y coordinatefalse
.public boolean contains3D(ILcdPoint aPoint)
false
.contains3D
in interface ILcdShape
aPoint
- a pointfalse
.ILcdShape.contains3D(double, double, double)
public boolean contains3D(double aX, double aY, double aZ)
false
.contains3D
in interface ILcdShape
aX
- An X coordinateaY
- An Y coordinateaZ
- A Z coordinatefalse
.public java.lang.Object clone()
TLcdProcedureTrajectory
object.
Note: the features of the new object are a shallow clone of the features of
this object.clone
in interface ILcdCloneable
clone
in class java.lang.Object
TLcdProcedureTrajectory
object.Object.clone()
public ILcdBounds getBounds()
getBounds
in interface ILcdBounded
public int getPointCount()
getPointCount
in interface ILcdPointList
public ILcdPoint getPoint(int aIndex) throws java.lang.IndexOutOfBoundsException
getPoint
in interface ILcdPointList
aIndex
- the index of the point to be retrievedjava.lang.IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= getPointCount()).public int getFeatureCount()
ILcdProcedure
,
if it is of the type ILcdFeatured
. Otherwise, 0 is returned.getFeatureCount
in interface ILcdFeatured
ILcdProcedure
if it is of the type ILcdFeatured
, or 0 otherwise.public java.lang.Object getFeature(int aIndex) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
ILcdProcedure
,
if it is of the type ILcdFeatured
. Otherwise, an UnsupportedOperationException
is thrown.getFeature
in interface ILcdFeatured
aIndex
- a valid feature index.ILcdProcedure
,
if it is of the type ILcdFeatured
.java.lang.IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= getFeatureCount()).java.lang.UnsupportedOperationException
- if the associated ILcdProcedure
is
not of the type ILcdFeatured
.ILcdFeatured.setFeature(int, java.lang.Object)
public void setFeature(int aIndex, java.lang.Object aObject) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
ILcdProcedure
,
if it is of the type ILcdFeatured
. Otherwise, an UnsupportedOperationException
is thrown.setFeature
in interface ILcdFeatured
aIndex
- the index of the feature to be setaObject
- the feature valuejava.lang.IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= getFeatureCount()).java.lang.UnsupportedOperationException
- if the associated ILcdProcedure
is
not of the type ILcdFeatured
.ILcdFeatured.getFeature(int)
,
ILcdFeatured.canSetFeature(int)
public boolean canSetFeature(int aIndex)
ILcdProcedure
can be set.
If the procedure is not of the type ILcdFeatured
, false
is returned.canSetFeature
in interface ILcdFeatured
aIndex
- the index of the feature to be settrue
if the feature at the given index can be set.public TLcdDataType getDataType()
ILcdDataObject
null
.getDataType
in interface ILcdDataObject
public java.lang.Object getValue(TLcdDataProperty aProperty)
ILcdDataObject
Returns the value of the given property.
If the property is a collection, the returned value will never be null. If the property has not been set, an empty collection of the appropriate type will be returned (Set, List or Map).
The property must not be null, and must be declared in the data object's type
or in one of its super types.
Otherwise an IllegalArgumentException
is thrown.
getValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be returnedpublic java.lang.Object getValue(java.lang.String aPropertyName)
ILcdDataObject
Convenience method that returns the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.getValue(TLcdDataProperty)
for more information.getValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be returnedTLcdDataType.getProperty(String)
public void setValue(TLcdDataProperty aProperty, java.lang.Object aValue)
ILcdDataObject
Sets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.
The given property must be declared in thedata object's type
or in one of its super types. In
other words, getDataType().getProperties().contains( aProperty ) should always be true.
Otherwise, the implementation should throw an IllegalArgumentException
.setValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be setaValue
- the value to setTLcdDataType.getProperty(String)
public void setValue(java.lang.String aPropertyName, java.lang.Object aValue)
ILcdDataObject
Convenience method that sets the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.setValue(TLcdDataProperty, Object)
for more information.setValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be setaValue
- the value to setpublic boolean hasValue(TLcdDataProperty aProperty)
ILcdDataObject
aProperty
is from the right data type
, and this instance has a value for it: returns true
aProperty
is from the right data type
, and this instance has no value for it: returns false
aProperty
is not from the right data type
: not allowed, you will get IllegalArgumentExceptionaProperty
is null
: not allowed, you will get NullPointerExceptionhasValue
in interface ILcdDataObject
aProperty
- the property for which to return whether a value is present or not.true
if this data object has a value for the given property, false
otherwise.public boolean hasValue(java.lang.String aPropertyName)
ILcdDataObject
ILcdDataObject.hasValue(TLcdDataProperty)
for more information.hasValue
in interface ILcdDataObject
aPropertyName
- the name of the property for which to return whether a value is present
or not.true
if this data object has a value for the property with the given name,
false
otherwise.