The source code for the Map Builder demonstration, which contains
all of the code described in this section, can be found at <installdir> /jviews-maps810/samples/mapbuilder/index.html
IlvMapDataSourceProperty
The IlvMapDataSourceProperty class is a named
property used to attach a IlvMapDataSourceModel to an IlvManager.
IlvManagerThis data source model controls
all data sources that you import into the manager. It is also
persistent data that is saved when you save the map.
Accessing the data source model
You can access the map data source model
by calling:
IlvMapDataSourceModel dsm = IlvMapDataSourceProperty.GetMapDataSourceModel(manager);
Adding a listener
As the
IlvMapDataSourceProperty
is a named property of the manager, you can add a listener that
is called whenever the property as a whole is changed, for
example:
manager.addNamedPropertyListener(new NamedPropertyListener() { public void propertyChanged(NamedPropertyEvent event) { if (event.getPropertyName().equals(IlvMapDataSourceProperty.NAME)) { IlvMapDataSourceProperty p = (IlvMapDataSourceProperty) event.getNewValue(); if (event.getType() == NamedPropertyEvent.PROPERTY_SET) { ...do something } } } });
Controlling data sources
You can allow users to edit and control individual data sources
by adding an
IlvDataSourcePanel
bean to your application. See Using the GUI beans.
For more information about the data source tree, see Creating data source objects, Using
data sources, and Developing
a new data source.
Note
Although the Data Source Tree contains a Tree structure, JViews Maps uses only a
single level tree, resulting in a simpler data source list.
Future versions, or user applications, may use the full tree
structure for advanced features.