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 Coordinate System Editor .
Including the bean in an application
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(vie w.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())); } });
Adding the bean to a Swing hierarchy
You can then add this bean to your Swing
hierarchy.
panel.add(dataSourcePanel, BorderLayout.CENTER);
Customizing the appearance and behavior
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);