Package com.luciad.lucy
Class TLcyDataFormatManager.ALcyHandlerChooser
java.lang.Object
com.luciad.lucy.TLcyDataFormatManager.ALcyHandlerChooser
- Enclosing class:
TLcyDataFormatManager
Class that represents the logic to choose a ILcdModelDecoder
or
ALcyDataSourceHandler
out of a list of candidates. The instance set on the
TLcyDataFormatManager
is triggered for every data source that needs to be handled.
Implementations could for example present the user with a dialog to choose the appropriate handler.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ILcdModelDecoder
chooseDataSourceDecoder
(ILcdDataSource aSource, ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aMapComponent, ILcdModelDecoder[] aModelDecoders, Component aParentComponent) Chooses theILcdModelDecoder
to use for the givenaDataSource
out of the list of given decoders.abstract Object
chooseHandler
(String aSourceName, ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aMapComponent, ILcdModelDecoder[] aModelDecoders, ALcyFileTypeDescriptor[] aModelDecoderFileTypeDescriptors, ALcyDataSourceHandler[] aDataSourceHandlers, ALcyFileTypeDescriptor[] aDataSourceHandlerFileTypeDescriptors, ALcyFileTypeDescriptor aSelectedFileTypeDescriptor, Component aParentComponent) Chooses theILcdModelDecoder
orALcyDataSourceHandler
to use for the given aSourceName out of the list of given handlers.
-
Constructor Details
-
ALcyHandlerChooser
public ALcyHandlerChooser()
-
-
Method Details
-
chooseHandler
public abstract Object chooseHandler(String aSourceName, ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aMapComponent, ILcdModelDecoder[] aModelDecoders, ALcyFileTypeDescriptor[] aModelDecoderFileTypeDescriptors, ALcyDataSourceHandler[] aDataSourceHandlers, ALcyFileTypeDescriptor[] aDataSourceHandlerFileTypeDescriptors, ALcyFileTypeDescriptor aSelectedFileTypeDescriptor, Component aParentComponent) throws TLcyUserCancelledExceptionChooses theILcdModelDecoder
orALcyDataSourceHandler
to use for the given aSourceName out of the list of given handlers.- Parameters:
aSourceName
- The data source to choose a handler for.aMapComponent
- The map on which the data will be opened, provided as contextual information.aModelDecoders
- An array 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
- An array 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:
- an object from
aModelDecoders
oraDataSourceHandlers
, ornull
in case none of the model decoders / data source handlers is capable of handling the source. - 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.
-
chooseDataSourceDecoder
public abstract ILcdModelDecoder chooseDataSourceDecoder(ILcdDataSource aSource, ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aMapComponent, ILcdModelDecoder[] aModelDecoders, Component aParentComponent) throws TLcyUserCancelledExceptionChooses theILcdModelDecoder
to use for the givenaDataSource
out of the list of given decoders.- Parameters:
aSource
- The data source to choose a handler for.aMapComponent
- The map on which the data will be opened, provided as contextual information.aModelDecoders
- An array ofILcdModelDecoder
s from which to choose.aParentComponent
- A parent component, used to display message dialogs.- Returns:
- an object from aModelDecoders or aDataSourceHandlers, or
null
in case none of the model decoders / data source handlers is capable of handling the source. - 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.
-