public class TLcdDAFIFTypeLoader extends Object
ILcdDAFIFSubTypeFilteringDecoder
implementation.Constructor and Description |
---|
TLcdDAFIFTypeLoader(String aName,
List aAvailableICAORegions,
List aAvailableICAOCountryCodes,
ILcdModelDecoder aModelDecoder)
Create a new loader instance.
|
TLcdDAFIFTypeLoader(String aName,
List aAvailableICAORegions,
List aAvailableICAOCountryCodes,
ILcdModelDecoder aModelDecoder,
boolean aEnableSubTypeFiltering)
Create a new loader instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addDAFIFLoaderListener(ILcdDAFIFLoaderListener aDAFIFLoaderListener)
Registers a listener for
TLcdDAFIFLoaderEvent
objects fired by this DAFIF loader. |
void |
addStatusListener(ILcdStatusListener aStatusListener)
Registers a status listener to use for monitoring the decoding progress of
this DAFIF loader.
|
void |
dispose()
Clean up before loader is removed: this removes all currently loaded models from the given view.
|
protected void |
fireDAFIFLoaderEvent(int aID,
String aRegion,
ILcdModel aModel)
Fires a
TLcdDAFIFLoaderEvent with the
specified properties. |
protected void |
fireDAFIFLoaderEvent(int aID,
String aRegion,
ILcdModel aModel,
boolean aShouldRepaintView)
Fires a
TLcdDAFIFLoaderEvent with the
specified properties. |
protected void |
fireDAFIFLoaderEvent(TLcdDAFIFLoaderEvent aEvent)
Fires a the specified DAFIF loader event.
|
List |
getAvailableICAOCountryNames()
Get the list of country names for all the ICAO region codes retrieved by getAvailableICAORegions
|
List |
getAvailableICAORegions()
Get the List of available ICAO regions (Strings) for this data type.
|
Object[] |
getAvailableSubTypes()
Get an array of enumerated values defining all subtypes of a given DAFIF(T) feature type.
|
int[] |
getCurrentICAORegionIndices()
Get an array of indices into the List of available ICAO regions that indicate the
currently loaded regions.
|
ILcdModel[] |
getCurrentModels()
Get an array of models that are currently loaded for this data type.
|
int[] |
getCurrentSubTypeIndices()
Get an array of indices into the list of available subtypes that indicates the
currently loaded subtypes.
|
ILcdModelDecoder |
getModelDecoder()
Get the model decoder used to decode DAFIF(T) records.
|
String |
getName()
Get the name of the DAFIF data type which this instance will keep track of.
|
int[] |
getNewICAORegionIndices()
Get an array of indices into the List of available ICAO regions that indicate the
desired regions.
|
int[] |
getNewSubTypeIndices()
Get an array of indices into the list of available subtypes that indicates the
desired subtypes.
|
static boolean |
isClassTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
protected void |
keep(ILcdModel[] aNewModelArray,
int aNewIndex,
int aCurrentIndex)
Keep the model corresponding to the region indicated by the element of fAvailableICAORegions
with index fCurrentICAORegionIndices[ aCurrentIndex ] in position aNewIndex of aNewModelArray.
|
protected void |
load(String aDAFIFRoot,
ILcdModel[] aNewModelArray,
int aNewIndex)
Load the model corresponding to the region indicated by the element of fAvailableICAORegions
with index fNewICAORegionIndices[ aNewIndex ] into position aNewIndex of aNewModelArray.
|
void |
modelRemovedExternally(ILcdModel aModel)
Signals that the given model has been removed by an external cause and that the current
status of the loader should be updated.
|
void |
removeDAFIFLoaderListener(ILcdDAFIFLoaderListener aDAFIFLoaderListener)
Unregisters the specified DAFIF loader listener.
|
void |
removeStatusListener(ILcdStatusListener aStatusListener)
Unregisters the specified status listener.
|
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setCurrentICAORegionIndices(int[] aCurrentICAORegionIndices)
This method is not part of the committed API and as such the behavior of this method is not
specified.
|
void |
setCurrentModels(ILcdModel[] aCurrentModels)
This method is not part of the committed API and as such the behavior of this method is not
specified.
|
void |
setNewICAORegionIndices(int[] aNewICAORegionIndices)
Set an array of indices into the List of available ICAO regions that indicate the
desired regions.
|
void |
setNewSubTypeIndices(int[] aSubTypeIndices)
Set an array of indices into the array of available subtypes that indicates which subtypes
must be decoded.
|
String |
toString() |
protected void |
unload(int aCurrentIndex)
Unload the model corresponding to the region indicated by the element of fAvailableICAORegions
with index fCurrentICAORegionIndices[ aCurrentIndex ].
|
protected void |
unload(int aCurrentIndex,
boolean aShouldRepaintView)
Unload the model corresponding to the region indicated by the element of fAvailableICAORegions
with index fCurrentICAORegionIndices[ aCurrentIndex ].
|
protected void |
unloadAll()
Unloads all current models.
|
void |
update(String aDAFIFRootDir)
Update the given view with data from the DAFIF source directory aDAFIFRootDir.
|
public TLcdDAFIFTypeLoader(String aName, List aAvailableICAORegions, List aAvailableICAOCountryCodes, ILcdModelDecoder aModelDecoder)
aName
- Name of the DAFIF data type which this instance will keep track of.aAvailableICAORegions
- List of available ICAO regions (Strings) for this data type.aAvailableICAOCountryCodes
- List of available ICAO country codes (Strings) for this data type.aModelDecoder
- Model decoder to use for decoding this data type.public TLcdDAFIFTypeLoader(String aName, List aAvailableICAORegions, List aAvailableICAOCountryCodes, ILcdModelDecoder aModelDecoder, boolean aEnableSubTypeFiltering)
ILcdDAFIFSubTypeFilteringDecoder
and aEnableSubTypeFiltering
is true, the loader will enable control over
the subtype filtering functionality of the decoder.aName
- Name of the DAFIF data type which this instance will keep track of.aAvailableICAORegions
- List of available ICAO regions (Strings) for this data type.aAvailableICAOCountryCodes
- List of available ICAO country codes (Strings) for this data type.aModelDecoder
- Model decoder to use for decoding this data type.aEnableSubTypeFiltering
- true if subtype filtering should be enabledpublic String getName()
public List getAvailableICAORegions()
public List getAvailableICAOCountryNames()
public Object[] getAvailableSubTypes()
ILcdDAFIFSubTypeFilteringDecoder.setSubTypesToDecode(int[])
.public ILcdModelDecoder getModelDecoder()
public void setCurrentModels(ILcdModel[] aCurrentModels)
aCurrentModels
- public ILcdModel[] getCurrentModels()
i
in the array corresponds to the region
availableICAORegions[ currentICAORegionIndices[ i ] ]
.public int[] getCurrentICAORegionIndices()
public void setCurrentICAORegionIndices(int[] aCurrentICAORegionIndices)
aCurrentICAORegionIndices
- public int[] getCurrentSubTypeIndices()
getAvailableSubTypes()
public int[] getNewICAORegionIndices()
public void setNewICAORegionIndices(int[] aNewICAORegionIndices)
aNewICAORegionIndices
- An array of indices into availableICAORegions.public int[] getNewSubTypeIndices()
getAvailableSubTypes()
that indicates desired subtypespublic void setNewSubTypeIndices(int[] aSubTypeIndices)
aSubTypeIndices
- an array of indices into the array of available subtypes.public void update(String aDAFIFRootDir)
aDAFIFRootDir
- Source directory from which to read. The region code is appended as a
subdirectory to this path.public void dispose()
protected void load(String aDAFIFRoot, ILcdModel[] aNewModelArray, int aNewIndex)
aDAFIFRoot
- The root directory containing the DAFIF data.aNewModelArray
- New array with loaded models.aNewIndex
- Index into fNewICAORegionIndices.protected void keep(ILcdModel[] aNewModelArray, int aNewIndex, int aCurrentIndex)
aNewModelArray
- New array with loaded models.aNewIndex
- Index into fNewICAORegionIndices.aCurrentIndex
- Position in fCurrentModels where the model to be kept is currently stored.protected void unload(int aCurrentIndex)
aCurrentIndex
- Index into fNewICAORegionIndices.protected void unload(int aCurrentIndex, boolean aShouldRepaintView)
aCurrentIndex
- Index into fNewICAORegionIndices.aShouldRepaintView
- a flag passed to the trigger event that tells the receiver if the view
should be repaint or not.protected void unloadAll()
public void modelRemovedExternally(ILcdModel aModel)
aModel
- The model that has been removed.public void addStatusListener(ILcdStatusListener aStatusListener)
aStatusListener
- an ILcdStatusListenerpublic void removeStatusListener(ILcdStatusListener aStatusListener)
aStatusListener
- a previously registered ILcdStatusListenerpublic void addDAFIFLoaderListener(ILcdDAFIFLoaderListener aDAFIFLoaderListener)
TLcdDAFIFLoaderEvent
objects fired by this DAFIF loader.aDAFIFLoaderListener
- an ILcdDAFIFLoaderListenerpublic void removeDAFIFLoaderListener(ILcdDAFIFLoaderListener aDAFIFLoaderListener)
aDAFIFLoaderListener
- a previously registered ILcdDAFIFLoaderListenerprotected void fireDAFIFLoaderEvent(int aID, String aRegion, ILcdModel aModel)
TLcdDAFIFLoaderEvent
with the
specified properties.aID
- the ID of the event (one of MODEL_ADDED
or MODEL_REMOVED
)aRegion
- the ICAO region that has been updatedaModel
- the model that has been added or removedprotected void fireDAFIFLoaderEvent(int aID, String aRegion, ILcdModel aModel, boolean aShouldRepaintView)
TLcdDAFIFLoaderEvent
with the
specified properties.aID
- the ID of the event (one of MODEL_ADDED
or MODEL_REMOVED
)aRegion
- the ICAO region that has been updatedaModel
- the model that has been added or removedaShouldRepaintView
- true if the event should trigger a view repaintprotected void fireDAFIFLoaderEvent(TLcdDAFIFLoaderEvent aEvent)
aEvent
- a TLcdDAFIFLoaderEventpublic static boolean isClassTraceOn()
true
if tracing is enabled for this class.public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.