| Programming with JViews Maps > Creating a Map Application Using the API > Using the GUI Beans > Display Preferences Editor |
Display Preferences Editor |
INDEX
PREVIOUS
NEXT
|
The Display Preferences Editor Bean is represented by the IlvJDisplayPreferencesEditorPanel class. This Bean enables users to set a map view to the units of their choice.
An example of the Display Preferences Editor is shown in Figure 3.9.
To include the Display Preferences Editor Bean in your application, you first need to create the panel:
IlvJDisplayPreferencesEditorPanel prefsPanel = new IlvJDisplayPreferencesEditorPanel();
Set the current preference properties of the view in the Bean:
prefsPanel.setDisplayPreferences(IlvDisplayPreferencesProperty.GetDisplayPreferences(view.getManager()));
Then, you can add a listener on the Bean that changes the view preferences when the user changes a preference:
prefsPanel.addDisplayPreferencesChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
IlvDisplayPreferences system = (IlvDisplayPreferences) e.getNewValue();
view.getManager().setNamedProperty(new IlvDisplayPreferencesProperty(system));
}
});
You can then add this Bean to your Swing hierarchy.
panel.add(prefsPanel, BorderLayout.WEST);
You can also use the API to define the distance or altitude units, date line wrapping or the coordinate formatter selected in the Bean with the setAltitudeUnit,setDistanceUnit, setUsingGeodeticComputation or setCoordinateFormatter methods.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |