Package com.luciad.lucy
Class TLcyDataFormatManager.ALcyMapComponentChooser
java.lang.Object
com.luciad.lucy.TLcyDataFormatManager.ALcyMapComponentChooser
- Enclosing class:
TLcyDataFormatManager
Class that represents the logic to choose one or multiple ILcyGenericMapComponent
(s)
out of a list of candidates. This class will only be triggered when the data could not be
loaded on the specified map. As a back-up mechanism, the TLcyDataFormatManager
tries to
load the data on another map, and this class allows to choose on which map(s) the
TLcyDataFormatManager
should retry.
Implementations could for example present the user with a dialog to choose the appropriate map component.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract List
<ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer>> chooseMapComponent
(ILcdDataSource aSource, ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aFailedMapComponent, List<ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer>> aMapComponentsToChooseFrom, ILcdModelDecoder[] aModelDecoders, Component aParentComponent) Chooses theILcyGenericMapComponent
(s) to use for the givenaSource
out of the list of given map components.abstract List
<ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer>> chooseMapComponent
(String aSourceName, ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aFailedMapComponent, List<ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer>> aMapComponentsToChooseFrom, ILcdModelDecoder[] aModelDecoders, ALcyFileTypeDescriptor[] aModelDecoderFileTypeDescriptors, ALcyDataSourceHandler[] aDataSourceHandlers, ALcyFileTypeDescriptor[] aDataSourceHandlerFileTypeDescriptors, ALcyFileTypeDescriptor aSelectedFileTypeDescriptor, Component aParentComponent) Chooses theILcyGenericMapComponent
(s) to use for the givenaSourceName
out of the list of given map components.
-
Constructor Details
-
ALcyMapComponentChooser
protected ALcyMapComponentChooser()The default constructor
-
-
Method Details
-
chooseMapComponent
public abstract List<ILcyGenericMapComponent<? extends ILcdView,? extends ILcdLayer>> chooseMapComponent(String aSourceName, ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aFailedMapComponent, List<ILcyGenericMapComponent<? extends ILcdView, throws TLcyUserCancelledException? extends ILcdLayer>> aMapComponentsToChooseFrom, ILcdModelDecoder[] aModelDecoders, ALcyFileTypeDescriptor[] aModelDecoderFileTypeDescriptors, ALcyDataSourceHandler[] aDataSourceHandlers, ALcyFileTypeDescriptor[] aDataSourceHandlerFileTypeDescriptors, ALcyFileTypeDescriptor aSelectedFileTypeDescriptor, Component aParentComponent) Chooses theILcyGenericMapComponent
(s) to use for the givenaSourceName
out of the list of given map components. Choosing multiple map components will result in opening the data source on multiple maps.- Parameters:
aSourceName
- The data source to choose a map component for.aFailedMapComponent
- The map component on which loading the data failed. Will not be included inaMapComponentsToChooseFrom
aMapComponentsToChooseFrom
- A list of map components from which to chooseaModelDecoders
- A list ofILcdModelDecoder
s from which to choose.aModelDecoderFileTypeDescriptors
- The file type descriptors corresponding to aModelDecoders. Isnull
iff aModelDecoders isnull
. Array must have equal length as aModelDecoders. It can contain null values for thoseILcdModelDecoder
s that don't work with files.aDataSourceHandlers
- A list ofALcyDataSourceHandler
s from which to choose.aDataSourceHandlerFileTypeDescriptors
- The file type descriptors corresponding to aDataSourceHandlers. Isnull
iff aDataSourceHandlers isnull
. Array must have equal length as aDataSourceHandlers. It can contain null values for thoseALcyDataSourceHandler
s that don't work with files.aSelectedFileTypeDescriptor
- The selected file type descriptor, can be used if there is ambiguity (multiple decoders can read a file). Can benull
for default behavior.aParentComponent
- A parent component, used to display message dialogs.- Returns:
- a list of map components, or an empty list. Must not be
null
. Each of the elements in the returned list must be included inaMapComponentsToChooseFrom
- Throws:
TLcyUserCancelledException
- This method can throw aTLcyUserCancelledException
to indicate that the user has decided to cancel the data loading instead of choosing a handler. In such case, theTLcyDataFormatManager
will not indicate to theTLcyDataFormatManager.getLogListener()
that the source failed, but rather swallow the exception.
-
chooseMapComponent
public abstract List<ILcyGenericMapComponent<? extends ILcdView,? extends ILcdLayer>> chooseMapComponent(ILcdDataSource aSource, ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aFailedMapComponent, List<ILcyGenericMapComponent<? extends ILcdView, throws TLcyUserCancelledException? extends ILcdLayer>> aMapComponentsToChooseFrom, ILcdModelDecoder[] aModelDecoders, Component aParentComponent) Chooses theILcyGenericMapComponent
(s) to use for the givenaSource
out of the list of given map components. Choosing multiple map components will result in opening the data source on multiple maps.- Parameters:
aSource
- The data source to choose a handler for.aFailedMapComponent
- The map component on which loading the data failed. Will not be included inaMapComponentsToChooseFrom
aMapComponentsToChooseFrom
- A list of map components from which to chooseaModelDecoders
- An array ofILcdModelDecoder
s from which to choose.aParentComponent
- A parent component, used to display message dialogs.- Returns:
- a list of map components, or an empty list. Must not be
null
. Each of the elements in the returned list must be included inaMapComponentsToChooseFrom
- Throws:
TLcyUserCancelledException
- This method can throw aTLcyUserCancelledException
to indicate that the user has decided to cancel the data loading instead of choosing a handler. In such case, theTLcyDataFormatManager
will not indicate to theTLcyDataFormatManager.getLogListener()
that the source failed, but rather swallow the exception.
-