Search in sources :

Example 1 with CoordinateFields

use of org.activityinfo.ui.client.widget.coord.CoordinateFields in project activityinfo by bedatadriven.

the class LocationForm method addCoordFields.

private void addCoordFields() {
    coordinateFields = new CoordinateFields();
    coordinateFields.setToolTip(I18N.CONSTANTS.coordinateToolTip());
    add(coordinateFields.getLatitudeField());
    add(coordinateFields.getLongitudeField());
    newLocationPresenter.addListener(NewLocationPresenter.POSITION_CHANGED, new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            if (!newLocationPresenter.isProvisional()) {
                coordinateFields.setValue(newLocationPresenter.getLatLng());
            }
        }
    });
    coordinateFields.addChangeListener(new Listener<FieldEvent>() {

        @Override
        public void handleEvent(FieldEvent be) {
            AiLatLng value = coordinateFields.getValue();
            if (value != null) {
                newLocationPresenter.setLatLng(value);
            }
        }
    });
}
Also used : AiLatLng(org.activityinfo.model.type.geo.AiLatLng) CoordinateFields(org.activityinfo.ui.client.widget.coord.CoordinateFields)

Aggregations

AiLatLng (org.activityinfo.model.type.geo.AiLatLng)1 CoordinateFields (org.activityinfo.ui.client.widget.coord.CoordinateFields)1