| Programming with JViews Maps > Creating a Map Application Using the API > Using the GUI Beans > Coordinate System Editor |
Coordinate System Editor |
INDEX
PREVIOUS
NEXT
|
The Coordinate System Editor Bean is represented by the IlvJCoordinateSystemEditorPanel class. This Bean enables users to set the coordinate system used to display a map view.
An example of the Coordinate System Editor is shown in Figure 3.8.
To include the Coordinate System Editor in your application, you first need to create the panel:
IlvJCoordinateSystemEditorPanel csPanel = new IlvJCoordinateSystemEditorPanel();
To display the current coordinate system of the view in the Bean, retrieve the IlvCoordinateSystemProperty property:
csPanel.setCoordinateSystem(IlvCoordinateSystemProperty.GetCoordinateSystem(view.getManager()));
Then, you should add a listener to the Bean that updates the coordinate system of the view when the Bean changes, retrieving the new value selected by the user:
csPanel.addCoordinateSystemChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
view.getManager().setNamedProperty(new IlvCoordinateSystemProperty(csPanel.getCoordinateSystem()));
}
});
You can then add this Bean to your Swing hierarchy.
panel.add(dataSourcePanel, BorderLayout.CENTER);
To configure the Coordinate System Editor as a simple projection choice combo-box, you can disable the Advanced Property panels. For example:
csPanel.setAdvancedPanelsVisible(false); csPanel.setAdvancedCheckBoxVisible(false);
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |