| Programming with JViews Maps > Creating a Map Application Using the API > Using the GUI Beans > Coordinate Panel Factory |
Coordinate Panel Factory |
INDEX
PREVIOUS
NEXT
|
The Coordinate Panel Factory Bean is represented by the IlvCoordinatePanelFactory class. This Bean is used in the Symbol Definition Window and in the terrain analysis features, but can be used whenever the application needs the user to point to a single coordinate or a rectangular area.
An example of the Coordinate Panel Factory for the input of a rectangular set of coordinates
is shown in Figure 3.20.
To include the Coordinate Panel Factory Bean in your application, you need a coordinate formatter (to determine how coordinates are displayed). You can, for example, retrieve the preferred coordinate formatter for the manager:
IlvDisplayPreferences prefs=IlvDisplayPreferencesProperty.GetDisplayPreferences(manager); IlvCoordinateFormatter formatter=prefs.getCoordinateFormatter();
Then you can create a Bean to input single point coordinates:
pointInputPanel = IlvCoordinatePanelFactory.createCoordPointInputPanel(view, formatter);
Or you can create a panel to input a rectangular zone:
rectInputPanel = IlvCoordinatePanelFactory.createCoordRectangleInputPanel (view,formatter);
You may then have to set the initial values:
pointInputPanel.setLatLon(Math.toRadians(22.5),Math.toRadians(12));
And add a listener that is invoked when the user enters or selects coordinates:
PropertyChangeListener listener= ...; pointInputPanel.addPropertyChangeListener(listener);
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |