Package com.luciad.realtime
Class ALcdSimulatorModel
java.lang.Object
com.luciad.realtime.ALcdSimulatorModel
- All Implemented Interfaces:
ILcdSimulatorModel
,ILcdPropertyChangeSource
- Direct Known Subclasses:
ALcdTimeIndexedSimulatorModel
Abstract convenience implementation of ILcdSimulatorModel that handles all properties
and their property change events. Setters are protected as they should only be used from
a subclass.
Subclasses must implement
updateTrackModels
to let the simulator data match the current date.- Since:
- 7.2
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a newALcdSimulatorModel
.protected
ALcdSimulatorModel
(ILcdModel[] aTrackModels, Date aBeginDate, Date aEndDate) Creates a newALcdSimulatorModel
with the given track models, begin date and end date. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener aListener) Adds the given listener to the list of listeners, so that it will receive property change events.protected void
Fires the givenPropertyChangeEvent
to all associated listeners.Returns the begin Date of the simulation.getDate()
Gets the Date corresponding to the current state of the domain objects (tracks) thisILcdSimulatorModel
contains.Returns the end Date of the simulation.Returns the array ofILcdModel
s holding the simulated domain data.void
Removes the given listener so that it no longer receives property change events.protected void
setBeginDate
(Date aBeginDate) Sets the begin date.void
Sets a new date.protected void
setEndDate
(Date aEndDate) Sets the end date.protected void
setTrackModels
(ILcdModel[] aTrackModels) Sets the track models property.protected abstract void
updateTrackModels
(Date aOldDate, Date aNewDate) Updates the track models of thisALcdSimulatorModel
to the given newDate
.
-
Constructor Details
-
ALcdSimulatorModel
protected ALcdSimulatorModel()Creates a newALcdSimulatorModel
. One must callsetTrackModels
,setBeginDate
andsetEndDate
to have a useful instance.- See Also:
-
ALcdSimulatorModel
Creates a newALcdSimulatorModel
with the given track models, begin date and end date.- Parameters:
aTrackModels
- The track models.aBeginDate
- The begin date.aEndDate
- The end date.- See Also:
-
-
Method Details
-
addPropertyChangeListener
Adds the given listener to the list of listeners, so that it will receive property change events.- Specified by:
addPropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aListener
- The listener to add.- See Also:
-
removePropertyChangeListener
Removes the given listener so that it no longer receives property change events.- Specified by:
removePropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aListener
- The listener to remove.- See Also:
-
firePropertyChangeEvent
Fires the givenPropertyChangeEvent
to all associated listeners.- Parameters:
aEvent
- The event to fire.
-
getTrackModels
Description copied from interface:ILcdSimulatorModel
Returns the array of
ILcdModel
s holding the simulated domain data. The state of the domain objects in these models is updated whensetDate
is called.A property change event must be fired whenever the return value of this method changes.
- Specified by:
getTrackModels
in interfaceILcdSimulatorModel
- Returns:
- The array of
ILcdModel
s holding the simulated domain data. This must not benull
. - See Also:
-
setTrackModels
Sets the track models property. A property change event is fired.- Parameters:
aTrackModels
- The new array of track models.- See Also:
-
getBeginDate
Description copied from interface:ILcdSimulatorModel
Returns the begin Date of the simulation.
A property change event must be fired whenever the return value of this method changes.
- Specified by:
getBeginDate
in interfaceILcdSimulatorModel
- Returns:
- The begin Date of the simulation. This must not be
null
.
-
setBeginDate
Sets the begin date. A property change event is fired.- Parameters:
aBeginDate
- The new begin date.- See Also:
-
getEndDate
Description copied from interface:ILcdSimulatorModel
Returns the end Date of the simulation.
A property change event must be fired whenever the return value of this method changes.
- Specified by:
getEndDate
in interfaceILcdSimulatorModel
- Returns:
- The end Date of the simulation. This must not be
null
.
-
setEndDate
Sets the end date. A property change event is fired.- Parameters:
aEndDate
- The new end date.- See Also:
-
getDate
Description copied from interface:ILcdSimulatorModel
Gets the Date corresponding to the current state of the domain objects (tracks) thisILcdSimulatorModel
contains.- Specified by:
getDate
in interfaceILcdSimulatorModel
- Returns:
- The Date of the current state.
- See Also:
-
setDate
Sets a new date. CallsupdateTrackModels(java.util.Date, java.util.Date)
to update the simulator data represented by thisALcdSimulatorModel
. Note that no property change event is fired.- Specified by:
setDate
in interfaceILcdSimulatorModel
- Parameters:
aDate
- The new date.- See Also:
-
updateTrackModels
Updates the track models of thisALcdSimulatorModel
to the given newDate
. This method is called bysetDate
.- Parameters:
aOldDate
- The old date, given as contextual information.aNewDate
- The date to update the track models of thisALcdSimulatorModel
to.
-