code: private MapController createMapController(Map map, final GraphicsController controller, String id) {
  		MapController mapController;
  		if (ToolId.TOOL_MEASURE_DISTANCE_MODE.equalsIgnoreCase(id)) {
  			mapController = new MeasureDistanceInfoControllerImpl(map, (MeasureDistanceController) controller);
  		} else {
  			mapController = new MapController(map, controller);
  		}
  		mapController.setActivationHandler(new ExportableFunction() {
  
  			public void execute() {
  				controller.onActivate();
  			}
  		});
  		mapController.setDeactivationHandler(new ExportableFunction() {
  
  			public void execute() {
  				controller.onDeactivate();
  			}
  		});
  		return mapController;
  	}
docs: ------------------------------------------------------------------------