Revision 13981 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/roi/ui/ROIManagerDialog.java

View differences:

ROIManagerDialog.java
51 51
import com.iver.andami.PluginServices;
52 52
import com.iver.andami.ui.mdiManager.IWindow;
53 53
import com.iver.andami.ui.mdiManager.WindowInfo;
54
import com.iver.cit.gvsig.fmap.MapControl;
54 55
import com.iver.cit.gvsig.fmap.layers.FLayer;
56
import com.iver.cit.gvsig.project.documents.view.gui.View;
55 57

  
56 58
/**
57 59
 * Di?logo para el gestor de ROIs.
......
65 67
	
66 68
	private ROIManagerPanel roiManagerPanel = null;
67 69
	
70
	private MapControl mapControl = null;
71
	
72
	private String previousTool = null;
73
	
68 74
	/**
69 75
	 * Constructor
70 76
	 * @param width Ancho del panel
......
74 80
		this.setSize(width, height);
75 81
		this.setLayout(new BorderLayout());
76 82
		this.add(getROIManagerPanel(), BorderLayout.CENTER);
83
		View view = (View) PluginServices.getMDIManager().getActiveWindow();
84
		mapControl = view.getMapControl();
85
		previousTool = mapControl.getCurrentTool();
86
		
77 87
	}
78 88

  
79 89
	public ROIManagerPanel getROIManagerPanel() {
......
116 126
	 */
117 127
	public void close() {
118 128
		try {
129
			roiManagerPanel.getMapControl().setTool(previousTool);
119 130
			PluginServices.getMDIManager().closeWindow(this);
120 131
		} catch (ArrayIndexOutOfBoundsException e) {
121 132
			//Si la ventana no se puede eliminar no hacemos nada

Also available in: Unified diff