| Programming with JViews Maps > Introducing the Main Classes > Map Specific Manager Properties > Data Source Tree |
Data Source Tree |
INDEX
PREVIOUS
NEXT
|
This section describes:
The source code for the Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir>/jviews-maps81/samples/mapbuilder/index.html
The IlvMapDataSourceProperty class is a named property used to attach a IlvMapDataSourceModel to an IlvManager.
This 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.
You can access the map data source model by calling:
IlvMapDataSourceModel dsm = IlvMapDataSourceProperty.GetMapDataSourceModel(manager);
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
}
}
}
});
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 Writing a Data Source.
This section describes the two ways to reload your data sources.
If you have created an instance of IlvSDMEngine (even empty) in your manager. To reload the data, you can simply write:
engine.loadData();
In case you do not want, or do not need, a symbol management utility, you can use the following code to reload your data:
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |