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:
If it finds multiple instances, the
TLcyDataFormatManager.ALcyHandlerChooserto determine the right model decoder or data source handler. The default implementation shows a pop-up dialog to let the user choose.
ALcyHandlerChooserdetermines that the string input is handled by an
ILcdModelDecoder, the model decoder is used to convert the string into an
ILcdModel. For this model, the layer factories registered with the
ILcyLucyEnvare used to create a layer:
ILcdGXYLayerFactoryfor GXY views and
ILspLayerFactoryfor Lightspeed views. The layer is added to the view of the map component.
ALcyHandlerChooserdetermines that an
ALcyDataSourceHandlerwill handle the string input, the string is passed to the
ALcyDataSourceHandlertogether with the
ILcyGenericMapComponent. It is up to the
ALcyDataSourceHandlerto 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
TLcyDataFormatManager.ALcyMapComponentChooserto determine whether to repeat this process on another map component.