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
ConstructorsModifierConstructorDescriptionprotectedCreates a newALcdSimulatorModel.protectedALcdSimulatorModel(ILcdModel[] aTrackModels, Date aBeginDate, Date aEndDate) Creates a newALcdSimulatorModelwith the given track models, begin date and end date. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(PropertyChangeListener aListener) Adds the given listener to the list of listeners, so that it will receive property change events.protected voidFires the givenPropertyChangeEventto all associated listeners.Returns the begin Date of the simulation.getDate()Gets the Date corresponding to the current state of the domain objects (tracks) thisILcdSimulatorModelcontains.Returns the end Date of the simulation.Returns the array ofILcdModels holding the simulated domain data.voidRemoves the given listener so that it no longer receives property change events.protected voidsetBeginDate(Date aBeginDate) Sets the begin date.voidSets a new date.protected voidsetEndDate(Date aEndDate) Sets the end date.protected voidsetTrackModels(ILcdModel[] aTrackModels) Sets the track models property.protected abstract voidupdateTrackModels(Date aOldDate, Date aNewDate) Updates the track models of thisALcdSimulatorModelto the given newDate.
-
Constructor Details
-
ALcdSimulatorModel
protected ALcdSimulatorModel()Creates a newALcdSimulatorModel. One must callsetTrackModels,setBeginDateandsetEndDateto have a useful instance.- See Also:
-
ALcdSimulatorModel
Creates a newALcdSimulatorModelwith 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:
addPropertyChangeListenerin 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:
removePropertyChangeListenerin interfaceILcdPropertyChangeSource- Parameters:
aListener- The listener to remove.- See Also:
-
firePropertyChangeEvent
Fires the givenPropertyChangeEventto all associated listeners.- Parameters:
aEvent- The event to fire.
-
getTrackModels
Description copied from interface:ILcdSimulatorModelReturns the array of
ILcdModels holding the simulated domain data. The state of the domain objects in these models is updated whensetDateis called.A property change event must be fired whenever the return value of this method changes.
- Specified by:
getTrackModelsin interfaceILcdSimulatorModel- Returns:
- The array of
ILcdModels 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:ILcdSimulatorModelReturns the begin Date of the simulation.
A property change event must be fired whenever the return value of this method changes.
- Specified by:
getBeginDatein 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:ILcdSimulatorModelReturns the end Date of the simulation.
A property change event must be fired whenever the return value of this method changes.
- Specified by:
getEndDatein 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:ILcdSimulatorModelGets the Date corresponding to the current state of the domain objects (tracks) thisILcdSimulatorModelcontains.- Specified by:
getDatein 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:
setDatein interfaceILcdSimulatorModel- Parameters:
aDate- The new date.- See Also:
-
updateTrackModels
Updates the track models of thisALcdSimulatorModelto 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 thisALcdSimulatorModelto.
-