Package org.geomajas.gwt.client.action.toolbar

Source Code of org.geomajas.gwt.client.action.toolbar.MeasureModalAction

/*
* This is part of Geomajas, a GIS framework, http://www.geomajas.org/.
*
* Copyright 2008-2011 Geosparc nv, http://www.geosparc.com/, Belgium.
*
* The program is available in open source according to the GNU Affero
* General Public License. All contributions in this program are covered
* by the Geomajas Contributors License Agreement. For full licensing
* details, see LICENSE.txt in the project root.
*/

package org.geomajas.gwt.client.action.toolbar;

import org.geomajas.gwt.client.action.ToolbarModalAction;
import org.geomajas.gwt.client.controller.MeasureDistanceController;
import org.geomajas.gwt.client.i18n.I18nProvider;
import org.geomajas.gwt.client.widget.MapWidget;

import com.smartgwt.client.widgets.events.ClickEvent;

/**
* Measure distance action.
*
* @author Pieter De Graef
*/
public class MeasureModalAction extends ToolbarModalAction {

  private MapWidget mapWidget;

  public MeasureModalAction(MapWidget mapWidget) {
    super("[ISOMORPHIC]/geomajas/osgeo/length-measure.png", I18nProvider.getToolbar().measureSelect());
    this.mapWidget = mapWidget;
  }

  public void onSelect(ClickEvent event) {
    mapWidget.setController(new MeasureDistanceController(mapWidget));
  }

  public void onDeselect(ClickEvent event) {
    mapWidget.setController(null);
  }
}
TOP

Related Classes of org.geomajas.gwt.client.action.toolbar.MeasureModalAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.