Revision 1081 org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ClippingProcess.java
ClippingProcess.java | ||
---|---|---|
47 | 47 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
48 | 48 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
49 | 49 |
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException; |
50 |
import org.gvsig.fmap.dal.coverage.process.IncrementableTask; |
|
50 |
import org.gvsig.fmap.dal.coverage.process.BaseIncrementableTask; |
|
51 |
import org.gvsig.fmap.dal.coverage.store.DataServerWriter; |
|
51 | 52 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
52 | 53 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
53 | 54 |
import org.gvsig.fmap.dal.coverage.store.parameter.NewRasterStoreParameters; |
... | ... | |
90 | 91 |
private AffineTransform affineTransform = null; |
91 | 92 |
private double[] wcValues = null; |
92 | 93 |
private RasterManager rManager = RasterLocator.getManager(); |
93 |
private NewRasterStoreParameters sparams = null;
|
|
94 |
private BaseIncrementableTask processIncrement = null;
|
|
94 | 95 |
|
95 | 96 |
/** |
96 | 97 |
* Variables de la resoluci?n de salida |
... | ... | |
99 | 100 |
private int resolutionHeight = 0; |
100 | 101 |
|
101 | 102 |
private Buffer buffer = null; |
102 |
private IncrementableTask task = null; |
|
103 | 103 |
|
104 | 104 |
/** |
105 | 105 |
* Par?metros obligatorios al proceso: |
... | ... | |
185 | 185 |
/** |
186 | 186 |
* Tarea de recorte |
187 | 187 |
*/ |
188 |
@SuppressWarnings("deprecation") |
|
188 | 189 |
public void process() throws ProcessInterruptedException { |
189 | 190 |
RasterDataStore dstoreCopy = null; |
190 | 191 |
RasterUtils util = RasterLocator.getManager().getRasterUtils(); |
191 |
task = null; |
|
192 | 192 |
|
193 | 193 |
try { |
194 | 194 |
long t2; |
... | ... | |
235 | 235 |
} |
236 | 236 |
|
237 | 237 |
insertLineLog(RasterToolsUtil.getText(this, "interpolando")); |
238 |
|
|
238 |
|
|
239 | 239 |
Buffer bufTmp = buffer; |
240 |
processIncrement = bufTmp.getIncrementableTask(Buffer.INCREMENTABLE_INTERPOLATION); |
|
240 | 241 |
buffer = bufTmp.getAdjustedWindow(resolutionWidth, resolutionHeight, interpolationMethod); |
241 | 242 |
if(bufTmp != buffer) |
242 | 243 |
bufTmp.dispose(); |
243 |
task = buffer.getIncrementableTask(); |
|
244 | 244 |
} else { |
245 | 245 |
try { |
246 | 246 |
if (util.isBufferTooBig(new double[] { 0, 0, resolutionWidth, resolutionHeight }, drawableBands.length)) |
... | ... | |
283 | 283 |
DataServerExplorerParameters eparams = manager.createServerExplorerParameters("FilesystemExplorer"); |
284 | 284 |
|
285 | 285 |
String finalFileName = ""; |
286 |
NewRasterStoreParameters sparams = null; |
|
287 |
processIncrement = RasterLocator.getManager().createDataServerWriter(); |
|
286 | 288 |
if (oneLayerPerBand) { |
287 | 289 |
long[] milis = new long[drawableBands.length]; |
288 | 290 |
String[] fileNames = new String[drawableBands.length]; |
... | ... | |
299 | 301 |
DataServerExplorer serverExplorer = manager.openServerExplorer(eparams.getExplorerName(), eparams); |
300 | 302 |
|
301 | 303 |
sparams = (NewRasterStoreParameters)serverExplorer.getAddParameters(provider); |
304 |
sparams.setDataServer((DataServerWriter)processIncrement); |
|
302 | 305 |
sparams.setDestination(path, file); |
303 | 306 |
sparams.setBuffer(buffer); |
304 | 307 |
sparams.setColorInterpretation(new String[]{ColorInterpretation.GRAY_BAND}); |
... | ... | |
370 | 373 |
} |
371 | 374 |
|
372 | 375 |
sparams = (NewRasterStoreParameters)serverExplorer.getAddParameters(provider); |
376 |
sparams.setDataServer((DataServerWriter)processIncrement); |
|
373 | 377 |
sparams.setDestination(path, file); |
374 | 378 |
sparams.setBuffer(buffer); |
375 | 379 |
if(colorInterp != null) |
... | ... | |
522 | 526 |
* @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getPercent() |
523 | 527 |
*/ |
524 | 528 |
public int getPercent() { |
525 |
if (task != null) { |
|
526 |
if ((task.getPercent() > 0) && (task.getPercent() < 99)) |
|
527 |
return task.getPercent(); |
|
528 |
} |
|
529 |
|
|
530 |
return (sparams != null) ? sparams.getPercent() : 0; |
|
529 |
return (processIncrement != null) ? processIncrement.getPercent() : 0; |
|
531 | 530 |
} |
532 | 531 |
|
533 | 532 |
/* |
... | ... | |
553 | 552 |
colorInterp = null; |
554 | 553 |
affineTransform = null; |
555 | 554 |
wcValues = null; |
556 |
sparams = null; |
|
557 | 555 |
buffer = null; |
558 |
task = null;
|
|
556 |
processIncrement = null;
|
|
559 | 557 |
if(selectedRois != null) { |
560 | 558 |
selectedRois.clear(); |
561 | 559 |
selectedRois = null; |
Also available in: Unified diff