|
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 theILcyGenericMapComponenton which the data must be loaded. -
The
TLcyDataFormatManagerretrieves all theILcdModelDecoderandALcyDataSourceHandlerinstances capable of handling that string from theILcyLucyEnv. -
If it finds multiple instances, the
TLcyDataFormatManageruses itsTLcyDataFormatManager.ALcyHandlerChooserto determine the right model decoder or data source handler. The default implementation shows a pop-up dialog to let the user choose. -
If the
ALcyHandlerChooserdetermines 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 theILcyLucyEnvare used to create a layer:ILcdGXYLayerFactoryfor GXY views andILspLayerFactoryfor Lightspeed views. The layer is added to the view of the map component.If the
ALcyHandlerChooserdetermines that anALcyDataSourceHandlerwill handle the string input, the string is passed to theALcyDataSourceHandlertogether with theILcyGenericMapComponent. It is up to theALcyDataSourceHandlerto 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, theTLcyDataFormatManageruses theTLcyDataFormatManager.ALcyMapComponentChooserto determine whether to repeat this process on another map component.