Revision 10626 trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/xyshift/fmap/XYShiftGeoprocess.java

View differences:

XYShiftGeoprocess.java
45 45
*
46 46
* $Id$
47 47
* $Log$
48
* Revision 1.2  2006-06-29 17:58:31  azabala
48
* Revision 1.3  2007-03-06 16:48:14  caballero
49
* Exceptions
50
*
51
* Revision 1.2  2006/06/29 17:58:31  azabala
49 52
* *** empty log message ***
50 53
*
51 54
* Revision 1.1  2006/06/28 18:17:21  azabala
......
57 60

  
58 61
import java.util.Map;
59 62

  
63
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
60 64
import com.hardcode.gdbms.engine.data.driver.DriverException;
61 65
import com.iver.andami.PluginServices;
62 66
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
......
91 95
	 * flag to only clip selection of input layer
92 96
	 */
93 97
	private boolean onlyInputLayerSelection = false;
94
	
98

  
95 99
	/**
96 100
	 * feature visitor to apply an xy shift
97 101
	 */
98 102
	private XYShifterFeatureVisitor visitor;
99
	
103

  
100 104
	/**
101 105
	 * Processes shifted features (writing them)
102 106
	 */
103 107
	FeaturePersisterProcessor2 processor;
104
	
108

  
105 109
	/**
106 110
	 * x offset
107 111
	 */
......
110 114
	 * y offset
111 115
	 */
112 116
	private double offsetY;
113
	
114
	
117

  
118

  
115 119
	public XYShiftGeoprocess(FLyrVect inputLayer){
116 120
		setFirstOperand(inputLayer);
117 121
	}
118
	
119
	
122

  
123

  
120 124
	public void setParameters(Map params) throws GeoprocessException {
121
		Boolean firstLayerSelection = (Boolean) 
125
		Boolean firstLayerSelection = (Boolean)
122 126
			params.get("firstlayerselection");
123 127
		if (firstLayerSelection != null)
124
			this.onlyInputLayerSelection = 
128
			this.onlyInputLayerSelection =
125 129
				firstLayerSelection.booleanValue();
126 130
		Double xShift = (Double)
127 131
			params.get("xshift");
......
156 160
	}
157 161

  
158 162
	/**
159
	 * ITask (cancelable and progres-monitorable task) which makes all 
163
	 * ITask (cancelable and progres-monitorable task) which makes all
160 164
	 * xyshift computations
161 165
	 * @author azabala
162 166
	 *
......
176 180
					int numShapes = firstLayer.getSource().getShapeCount();
177 181
					setFinalStep(numShapes);
178 182
				}//else
179
			} catch (com.iver.cit.gvsig.fmap.DriverException e) {
183
			} catch (ReadDriverException e) {
180 184
				// TODO Auto-generated catch block
181 185
				e.printStackTrace();
182
			} catch (DriverIOException e) {
183
				// TODO Auto-generated catch block
184
				e.printStackTrace();
185 186
			}
186 187
			setDeterminatedProcess(true);
187 188
			setStatusMessage(PluginServices.getText(this, "XYShift._Progress_Message"));
188
			
189

  
189 190
		}
190
		
191

  
191 192
		public void run() throws Exception {
192 193
			processor =
193 194
				new FeaturePersisterProcessor2(writer);
......
203 204
				e.printStackTrace();
204 205
			}
205 206
		}
206
		
207

  
207 208
		//TODO INTERNACIONALIZAR LOS MENSAJES
208 209
		public String getNote() {
209
			return "Desplazando features..."  + 
210
			return "Desplazando features..."  +
210 211
			" " +
211
			getCurrentStep()+ 
212
			getCurrentStep()+
212 213
			" "+
213 214
			"de"+
214 215
			" "+
......
220 221
			XYShiftGeoprocess.this.cancel();
221 222
		}
222 223
	}
223
	
224
	
224

  
225

  
225 226
	public IMonitorableTask createTask() {
226 227
		return new XYShiftTask();
227 228
	}
......
236 237
			try {
237 238
				resultLayerDefinition = DefinitionUtils.
238 239
					createLayerDefinition(super.firstLayer);
239
			} catch (DriverException e) {
240
			} catch (ReadDriverException e) {
240 241
				// TODO Auto-generated catch block
241 242
				e.printStackTrace();
242
			} catch (com.iver.cit.gvsig.fmap.DriverException e) {
243
				// TODO Auto-generated catch block
244
				e.printStackTrace();
245 243
			}
246 244
		}
247 245
		return resultLayerDefinition;
248 246
	}
249
	
247

  
250 248
	private DefaultCancellableMonitorable createCancelMonitor() {
251 249
		DefaultCancellableMonitorable monitor = new DefaultCancellableMonitorable();
252 250
		monitor.setInitialStep(0);
......
260 258
					numSteps = firstLayer.getSource().getShapeCount();
261 259
			}
262 260
			monitor.setFinalStep(numSteps);
263
		} catch (DriverIOException e) {
261
		} catch (ReadDriverException e) {
264 262
			// TODO Auto-generated catch block
265 263
			e.printStackTrace();
266
		} catch (com.iver.cit.gvsig.fmap.DriverException e) {
267
			// TODO Auto-generated catch block
268
			e.printStackTrace();
269 264
		}
270 265
		return monitor;
271 266
	}

Also available in: Unified diff