45 |
45 |
*
|
46 |
46 |
* $Id$
|
47 |
47 |
* $Log$
|
48 |
|
* Revision 1.1 2006-05-24 21:13:09 azabala
|
|
48 |
* Revision 1.2 2006-06-08 18:22:31 azabala
|
|
49 |
* Se a?ade chequeo de capas vac?as antes de a?adir result al TOC
|
|
50 |
*
|
|
51 |
* Revision 1.1 2006/05/24 21:13:09 azabala
|
49 |
52 |
* primera version en cvs despues de refactoring orientado a crear un framework extensible de geoprocessing
|
50 |
53 |
*
|
51 |
54 |
* Revision 1.1 2006/04/11 17:55:51 azabala
|
... | ... | |
55 |
58 |
*/
|
56 |
59 |
package com.iver.cit.gvsig.geoprocess.core.gui;
|
57 |
60 |
|
|
61 |
import javax.swing.JComponent;
|
|
62 |
import javax.swing.JOptionPane;
|
|
63 |
|
|
64 |
import com.iver.andami.PluginServices;
|
|
65 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
|
58 |
66 |
import com.iver.cit.gvsig.fmap.layers.CancelationException;
|
59 |
67 |
import com.iver.cit.gvsig.fmap.layers.FLayers;
|
|
68 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
|
60 |
69 |
import com.iver.cit.gvsig.geoprocess.core.fmap.GeoprocessException;
|
61 |
70 |
import com.iver.cit.gvsig.geoprocess.core.fmap.IGeoprocess;
|
62 |
71 |
import com.iver.utiles.swing.threads.IMonitorableTask;
|
... | ... | |
135 |
144 |
|
136 |
145 |
public void run() throws GeoprocessException {
|
137 |
146 |
try {
|
138 |
|
layers.addLayer(geoprocess.getResult());
|
|
147 |
FLyrVect result = geoprocess.getResult();
|
|
148 |
if(result.getSource().getShapeCount() > 0)
|
|
149 |
layers.addLayer(result);
|
|
150 |
else{
|
|
151 |
JOptionPane.showMessageDialog(
|
|
152 |
(JComponent) PluginServices.
|
|
153 |
getMDIManager().
|
|
154 |
getActiveView(),
|
|
155 |
PluginServices.
|
|
156 |
getText(this, "Error_capa_vacia"),
|
|
157 |
"Error",
|
|
158 |
JOptionPane.ERROR_MESSAGE);
|
|
159 |
}
|
|
160 |
|
139 |
161 |
} catch (CancelationException e) {
|
140 |
162 |
throw new GeoprocessException(
|
141 |
163 |
"Error al a?adir el resultado de un geoproceso a flayers");
|
142 |
|
} finally {
|
|
164 |
} catch (DriverIOException e) {
|
|
165 |
throw new GeoprocessException(
|
|
166 |
"Error al comprobar si el resultado de un geoproceso tiene registros");
|
|
167 |
} finally {
|
143 |
168 |
finished = true;
|
144 |
169 |
}
|
145 |
170 |
}
|