The functionality explained here relies on the services mechanism. Make sure that you are familiar with the services mechanism in Lucy before reading this article. |
When a user tries to open a data source using File→ Open, File→ Connect to, or drag-and-drop, the following sequence of actions is triggered:
-
The string that represents the path to the file or the URL to the server is passed to the
TLcyDataFormatManager
, together with theILcyGenericMapComponent
on which the data must be loaded. -
The
TLcyDataFormatManager
retrieves all theILcdModelDecoder
andALcyDataSourceHandler
instances capable of handling that string from theILcyLucyEnv
. -
If it finds multiple instances, the
TLcyDataFormatManager
uses itsTLcyDataFormatManager.ALcyHandlerChooser
to determine the right model decoder or data source handler. The default implementation shows a pop-up dialog to let the user choose. -
If the
ALcyHandlerChooser
determines that the string input is handled by anILcdModelDecoder
, the model decoder is used to convert the string into anILcdModel
. For this model, the layer factories registered with theILcyLucyEnv
are used to create a layer:ILcdGXYLayerFactory
for GXY views andILspLayerFactory
for Lightspeed views. The layer is added to the view of the map component.If the
ALcyHandlerChooser
determines that anALcyDataSourceHandler
will handle the string input, the string is passed to theALcyDataSourceHandler
together with theILcyGenericMapComponent
. It is up to theALcyDataSourceHandler
to determine what to do with the string. For example, a handler for a WMS URL could decide to present the users with a dialog that lets them choose which WMS layer they want to load. -
If the data cannot be loaded on the original
ILcyGenericMapComponent
, theTLcyDataFormatManager
uses theTLcyDataFormatManager.ALcyMapComponentChooser
to determine whether to repeat this process on another map component.