Revision 10626 trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/core/gui/AddResultLayerTask.java

View differences:

AddResultLayerTask.java
45 45
*
46 46
* $Id$
47 47
* $Log$
48
* Revision 1.5  2006-10-20 14:29:07  azabala
48
* Revision 1.6  2007-03-06 16:47:58  caballero
49
* Exceptions
50
*
51
* Revision 1.5  2006/10/20 14:29:07  azabala
49 52
* temporal bug fixed (problems when we add FLayers to another FLayers)
50 53
*
51 54
* Revision 1.4  2006/08/29 07:56:30  cesar
......
70 73
import javax.swing.JComponent;
71 74
import javax.swing.JOptionPane;
72 75

  
76
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
73 77
import com.iver.andami.PluginServices;
74
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
75 78
import com.iver.cit.gvsig.fmap.layers.CancelationException;
76 79
import com.iver.cit.gvsig.fmap.layers.FLayer;
77 80
import com.iver.cit.gvsig.fmap.layers.FLayers;
......
151 154
	public void cancel() {
152 155
		finished = true;
153 156
	}
154
	
157

  
155 158
	private boolean checkToAdd(FLayer layer) throws GeoprocessException{
156 159
		try {
157 160
			if(layer instanceof FLyrVect){
158 161
				FLyrVect result = (FLyrVect) layer;
159 162
				if(result.getSource().getShapeCount() > 0){
160 163
					return true;
161
				}else
162
					return false;
164
				}
165
				return false;
163 166
			}else if (layer instanceof FLayers){
164 167
				FLayers result = (FLayers) layer;
165 168
				int numLayers = result.getLayersCount();
......
175 178
				return false;
176 179
			}else//TODO Verificar esto si queremos meter en geoprocessing capas raster
177 180
				return false;
178
		} catch (DriverIOException e) {
181
		} catch (ReadDriverException e) {
179 182
			throw new GeoprocessException("Error al chequear la capa resultado antes de pasarla al TOC");
180 183
		}
181 184
	}
......
195 198
				JOptionPane.showMessageDialog(
196 199
						(JComponent) PluginServices.
197 200
							getMDIManager().
198
							getActiveWindow(), 
201
							getActiveWindow(),
199 202
						PluginServices.
200
							getText(this, "Error_capa_vacia"), 
203
							getText(this, "Error_capa_vacia"),
201 204
							"Error",
202 205
						JOptionPane.ERROR_MESSAGE);
203 206
			}
204
				
207

  
205 208
		} catch (CancelationException e) {
206 209
			throw new GeoprocessException(
207 210
					"Error al a?adir el resultado de un geoproceso a flayers");

Also available in: Unified diff