Programming with JViews Maps > Creating a Map Application Using the API > Using the GUI Beans > Coordinate System Editor

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.

coordsystem.png

Figure 3.8 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(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()));
  }
});

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);