public class TLcdTimeFilteredSimulatorModel extends Object implements ILcdSimulatorModel
Decorator for an ILcdSimulatorModel
which allows to limit the exposed available time
interval of the ILcdSimulatorModel
.
Graphically, it can be seen as (where I stands for the inner ILcdSimulatorModel
and
O for the outer):
| | | | | | -----------|---------------|----------------|--------------------| | | | | | I#getBeginDate I#getDate I#getEndDate O#getBeginDate O#getDate O#getEndDate
The setFilterBeginDate
and
setFilterEndDate
methods allow to specify where
the begin date and end date of this
ILcdSimulatorModel
are located. They must be in the valid interval of the inner
simulator model, or they will be adjusted when invalid.
Constructor and Description |
---|
TLcdTimeFilteredSimulatorModel() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Registers the given
PropertyChangeListener to be notified when this object's
properties change. |
Date |
getBeginDate()
Returns the begin Date of the simulation.
|
Date |
getDate()
Gets the Date corresponding to the current state of the domain objects (tracks) this
ILcdSimulatorModel contains. |
Date |
getEndDate()
Returns the end Date of the simulation.
|
ILcdSimulatorModel |
getSimulatorModelToFilterOnTime()
Returns the
ILcdSimulatorModel currently being filtered. |
ILcdModel[] |
getTrackModels()
Returns the array of
ILcdModel s holding the simulated domain data. |
void |
removePropertyChangeListener(PropertyChangeListener l)
De-registers the given
PropertyChangeListener from receiving property change events
for this object. |
void |
setBeginDate(Date aBeginDate)
Sets the begin date to consider.
|
void |
setDate(Date aDate)
Asks this
ILcdSimulatorModel to update the domain objects (tracks) of the
simulation it contains, in order to be in the state in which they were or should be at the
given Date. |
void |
setEndDate(Date aEndDate)
Sets the end date to consider.
|
void |
setSimulatorModelToFilterOnTime(ILcdSimulatorModel aSimulatorModelToFilterOnTime)
Sets the
ILcdSimulatorModel to filter. |
public void setSimulatorModelToFilterOnTime(ILcdSimulatorModel aSimulatorModelToFilterOnTime)
ILcdSimulatorModel
to filter.aSimulatorModelToFilterOnTime
- The ILcdSimulatorModel
to filter.getSimulatorModelToFilterOnTime()
public ILcdSimulatorModel getSimulatorModelToFilterOnTime()
ILcdSimulatorModel
currently being filtered.ILcdSimulatorModel
currently being filtered.setSimulatorModelToFilterOnTime(ILcdSimulatorModel)
public ILcdModel[] getTrackModels()
ILcdSimulatorModel
Returns the array of ILcdModel
s holding the simulated domain data. The state of
the domain objects in these models is updated when setDate
is called.
A property change event must be fired whenever the return value of this method changes.
getTrackModels
in interface ILcdSimulatorModel
ILcdModel
s holding the simulated domain data. This must not be
null
.ILcdSimulatorModel.setDate(java.util.Date)
public void setBeginDate(Date aBeginDate)
ILcdSimulatorModel
.aBeginDate
- The begin date to set.getBeginDate()
public void setEndDate(Date aEndDate)
ILcdSimulatorModel
.aEndDate
- The end date to set.getEndDate()
public void setDate(Date aDate)
ILcdSimulatorModel
ILcdSimulatorModel
to update the domain objects (tracks) of the
simulation it contains, in order to be in the state in which they were or should be at the
given Date. This state might include location, feature values, etc.
The TLcdSimulator
always calls this method on the AWT Event Dispatch Thread
Implementations of this method should respect the threading rules of LuciadLightspeed. Specifically, implementations should take a write lock on the track models they update when creating a multithreaded application.
setDate
in interface ILcdSimulatorModel
aDate
- The Date to update to. This is never null
.ILcdSimulatorModel.getTrackModels()
,
ILcdSimulatorModel.getDate()
,
TLcdLockUtil.writeLock(Object)
public Date getDate()
ILcdSimulatorModel
ILcdSimulatorModel
contains.getDate
in interface ILcdSimulatorModel
ILcdSimulatorModel.setDate(Date)
public Date getBeginDate()
ILcdSimulatorModel
Returns the begin Date of the simulation.
A property change event must be fired whenever the return value of this method changes.
getBeginDate
in interface ILcdSimulatorModel
null
.public Date getEndDate()
ILcdSimulatorModel
Returns the end Date of the simulation.
A property change event must be fired whenever the return value of this method changes.
getEndDate
in interface ILcdSimulatorModel
null
.public void addPropertyChangeListener(PropertyChangeListener l)
ILcdPropertyChangeSource
Registers the given PropertyChangeListener
to be notified when this object's
properties change.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this change source,
you can use a ALcdWeakPropertyChangeListener
instance as property change listener.
addPropertyChangeListener
in interface ILcdPropertyChangeSource
l
- The listener to be notifiedALcdWeakPropertyChangeListener
,
ILcdPropertyChangeSource.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener l)
ILcdPropertyChangeSource
De-registers the given PropertyChangeListener
from receiving property change events
for this object.
If the listener was added more than once, it will be notified one less time after being
removed.
If the listener is null
, or was never added, no exception is thrown and no action is taken.
removePropertyChangeListener
in interface ILcdPropertyChangeSource
l
- the listener that should no longer be notified of changes of
this object's propertiesILcdPropertyChangeSource.addPropertyChangeListener(java.beans.PropertyChangeListener)