public void setElement(EditableElement element) {
    MapContext mapContext = (MapContext) element.getObject();
    try {
      mapControl.setMapContext(mapContext);
      mapControl.setElement(element);
      mapControl.setDefaultTool(getIndependentToolInstance(defaultTool, defaultMouseCursor));
      mapControl.initMapControl();
      mapEditor.setContentPane(mapControl);
      mapToolBar.setPreferredSize(new Dimension(mapControl.getWidth(), 30));
      mapToolBar.setFloatable(false);
      mapEditor.add(mapToolBar, BorderLayout.PAGE_END);

    } catch (TransitionException e) {
      Services.getErrorManager().error(I18N.getString("orbisgis.core.tool.not_valid"), e);
    } catch (InstantiationException e) {
      Services.getErrorManager().error(I18N.getString("orbisgis.core.tool.not_valid"), e);
    } catch (IllegalAccessException e) {
      Services.getErrorManager().error(I18N.getString("orbisgis.core.tool.not_valid"), e);
    }

    this.mapElement = element;
  }
 public void setShowInfo(boolean showInfo) {
   mapControl.setShowCoordinates(showInfo);
 }
 public boolean getShowInfo() {
   return mapControl.getShowCoordinates();
 }
 public MapTransform getMapTransform() {
   return mapControl.getMapTransform();
 }
 public void delete() {
   mapControl.closing();
 }