Revision 1040
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultFLyrRaster.java | ||
---|---|---|
130 | 130 |
import org.gvsig.tools.persistence.PersistentState; |
131 | 131 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
132 | 132 |
import org.gvsig.tools.task.Cancellable; |
133 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
134 |
import org.gvsig.tools.task.TaskStatusManager; |
|
133 | 135 |
import org.slf4j.Logger; |
134 | 136 |
import org.slf4j.LoggerFactory; |
135 | 137 |
|
... | ... | |
589 | 591 |
} |
590 | 592 |
|
591 | 593 |
if (isWithinScale(scale)) { |
592 |
/*if (status != null && firstLoad) { |
|
593 |
if (mustTileDraw) { |
|
594 |
Point2D p = vp.getOffset(); |
|
595 |
Rectangle r = new Rectangle((int) p.getX(), (int) p.getY(), vp.getImageWidth(), vp.getImageHeight()); |
|
596 |
Tiling tiles = new Tiling(maxTileDrawWidth, maxTileDrawHeight, r); |
|
597 |
tiles.setAffineTransform((AffineTransform) vp.getAffineTransform().clone()); |
|
598 |
for (int tileNr = 0; tileNr < tiles.getNumTiles(); tileNr++) |
|
599 |
// drawing part |
|
600 |
try { |
|
601 |
ViewPort vport = tiles.getTileViewPort(vp, tileNr); |
|
602 |
// g.setClip(tiles.getClip(tileNr).x, tiles.getClip(tileNr).y, tiles.getClip(tileNr).width - 5, tiles.getClip(tileNr).height); |
|
603 |
draw(image, g, vport, cancel); |
|
604 |
} catch (InterruptedException e) { |
|
605 |
System.out.println("Se ha cancelado el pintado"); |
|
606 |
} catch (InvalidSetViewException e) { |
|
607 |
throw new ReadException("Error reading file.", e); |
|
608 |
} catch (RasterDriverException e) { |
|
609 |
throw new ReadException("Error reading file.", e); |
|
610 |
} catch (NoninvertibleTransformException e) { |
|
611 |
throw new ReadException("Error in the transformation.", e); |
|
612 |
} |
|
613 |
} else |
|
614 |
try { |
|
615 |
draw(image, g, vp, cancel); |
|
616 |
} catch (InterruptedException e) { |
|
617 |
System.out.println("Se ha cancelado el pintado"); |
|
618 |
} catch (InvalidSetViewException e) { |
|
619 |
throw new ReadException("Error reading file.", e); |
|
620 |
} catch (RasterDriverException e) { |
|
621 |
throw new ReadException("Error reading file.", e); |
|
622 |
} |
|
623 |
try { |
|
624 |
status.applyStatus(this); |
|
625 |
} catch (NotSupportedExtensionException e) { |
|
626 |
throw new ReadException("Error in input file", e); |
|
627 |
} catch (FilterTypeException e) { |
|
628 |
throw new ReadException("Error setting filters from a project.", e); |
|
629 |
} catch (RasterDriverException e) { |
|
630 |
throw new ReadException("Error reading file.", e); |
|
631 |
} catch (FileNotFoundInListException e) { |
|
632 |
throw new ReadException("Error reading file.", e); |
|
633 |
} catch (OperationNotSupportedException e) { |
|
634 |
throw new ReadException("Error reading file.", e); |
|
635 |
} catch (FilterManagerException e) { |
|
636 |
throw new ReadException("Error reading file.", e); |
|
637 |
} catch (InvalidSourceException e) { |
|
638 |
throw new ReadException("Invalid file.", e); |
|
639 |
} |
|
640 |
firstLoad = false; |
|
641 |
}*/ |
|
642 |
|
|
594 |
|
|
643 | 595 |
if (mustTileDraw) { |
644 | 596 |
Point2D p = vp.getOffset(); |
645 | 597 |
Rectangle r = new Rectangle((int) p.getX(), (int) p.getY(), vp.getImageWidth(), vp.getImageHeight()); |
... | ... | |
693 | 645 |
vp2.setMat(vp.getAffineTransform()); |
694 | 646 |
//vp2.setTime(vp.getTime()); |
695 | 647 |
|
648 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
649 |
SimpleTaskStatus taskStatus = manager.createDefaultSimpleTaskStatus("Drawing " + getName() + "..."); |
|
650 |
manager.add(taskStatus); |
|
651 |
|
|
696 | 652 |
try { |
697 | 653 |
if(getDataStore().isTiled()) |
698 |
getRender().drawTiledService(g, vp2, vp.getImageSize()); |
|
699 |
else |
|
700 |
getRender().draw(g, vp2); |
|
654 |
getRender().drawTiledService(g, vp2, vp.getImageSize(), taskStatus); |
|
655 |
else { |
|
656 |
getRender().draw(g, vp2, taskStatus); |
|
657 |
taskStatus.terminate(); |
|
658 |
} |
|
701 | 659 |
} catch (ProcessInterruptedException e1) { |
702 | 660 |
} |
703 | 661 |
} |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterQuery.java | ||
---|---|---|
28 | 28 |
import org.gvsig.raster.cache.tile.provider.CacheStruct; |
29 | 29 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
30 | 30 |
import org.gvsig.timesupport.Time; |
31 |
import org.gvsig.tools.task.TaskStatus; |
|
31 | 32 |
|
32 | 33 |
/** |
33 | 34 |
* Interfaz que contiene las operaciones que debe soportar la carga de datos |
... | ... | |
267 | 268 |
* Cache structure force by the client |
268 | 269 |
*/ |
269 | 270 |
public void setTileParameters(int level, int tileCol, int tileRow, Extent extent, CacheStruct cacheStruct); |
271 |
|
|
272 |
/** |
|
273 |
* Sets the task status |
|
274 |
* @param taskStatus |
|
275 |
*/ |
|
276 |
public void setTaskStatus(TaskStatus taskStatus); |
|
270 | 277 |
} |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/Render.java | ||
---|---|---|
33 | 33 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
34 | 34 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
35 | 35 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
36 |
import org.gvsig.tools.task.TaskStatus; |
|
36 | 37 |
|
37 | 38 |
|
38 | 39 |
|
... | ... | |
193 | 194 |
* |
194 | 195 |
* @param g Graphics sobre el que se pinta |
195 | 196 |
* @param vp ViewPort de la extensi?n a dibujar |
197 |
* @param taskStatus |
|
196 | 198 |
* @throws InvalidSetViewException |
197 | 199 |
* @throws ArrayIndexOutOfBoundsException |
198 | 200 |
*/ |
199 |
public void draw(Graphics2D g, ViewPortData vp) |
|
201 |
public void draw(Graphics2D g, ViewPortData vp, TaskStatus taskStatus)
|
|
200 | 202 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException; |
201 | 203 |
|
202 | 204 |
/** |
... | ... | |
209 | 211 |
* @throws InvalidSetViewException |
210 | 212 |
* @throws ProcessInterruptedException |
211 | 213 |
*/ |
212 |
public void drawTiledService(Graphics2D g, ViewPortData vp, Dimension2D viewDimension) |
|
214 |
public void drawTiledService(Graphics2D g, ViewPortData vp, Dimension2D viewDimension, TaskStatus status)
|
|
213 | 215 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException; |
214 | 216 |
|
215 | 217 |
/** |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataStore.java | ||
---|---|---|
64 | 64 |
import org.gvsig.metadata.exceptions.MetadataException; |
65 | 65 |
import org.gvsig.raster.cache.tile.Tile; |
66 | 66 |
import org.gvsig.raster.cache.tile.exception.TileGettingException; |
67 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
|
68 | 67 |
import org.gvsig.raster.impl.DefaultRasterManager; |
69 | 68 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
70 | 69 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
... | ... | |
153 | 152 |
setQueryAllDrawableBands(); |
154 | 153 |
|
155 | 154 |
setMemoryBuffer(q.isMemoryBuffer()); |
156 |
|
|
157 | 155 |
Buffer buf = null; |
156 |
|
|
157 |
//***************************************** |
|
158 |
//All data |
|
159 |
//***************************************** |
|
158 | 160 |
if(q.getType() == DefaultRasterQuery.TYPE_ENTIRE) { |
159 |
buf = setAreaOfInterest(); |
|
160 |
Extent e = getExtent(); |
|
161 |
buf.setDataExtent(new Rectangle2D.Double(e.getULX(), e.getULY() - (e.getMax().getY() - e.getMin().getY()), |
|
162 |
e.getMax().getX() - e.getMin().getX(), |
|
163 |
e.getMax().getY() - e.getMin().getY())); |
|
161 |
step = null; |
|
162 |
dataExtent = getExtent(); |
|
163 |
buf = getWindow(0, 0, (int)getWidth(), (int)getHeight()); |
|
164 |
buf.setDataExtent( |
|
165 |
new Rectangle2D.Double(dataExtent.getULX(), dataExtent.getULY() - (dataExtent.getMax().getY() - dataExtent.getMin().getY()), |
|
166 |
dataExtent.getMax().getX() - dataExtent.getMin().getX(), |
|
167 |
dataExtent.getMax().getY() - dataExtent.getMin().getY())); |
|
164 | 168 |
} |
165 | 169 |
|
170 |
//***************************************** |
|
171 |
//Real coordinates without resampling |
|
172 |
//***************************************** |
|
166 | 173 |
if(q.getType() == DefaultRasterQuery.TYPE_COORDS) { |
167 |
buf = setAreaOfInterest(q.getX(), q.getY(), q.getW(), q.getH());
|
|
174 |
buf = setAreaOfInterestInWC(q);
|
|
168 | 175 |
buf.setDataExtent(new Rectangle2D.Double(q.getX(), q.getY(), q.getW(), q.getH())); |
169 | 176 |
} |
170 | 177 |
|
178 |
//***************************************** |
|
179 |
//Real coordinates with resampling |
|
180 |
//***************************************** |
|
171 | 181 |
if(q.getType() == DefaultRasterQuery.TYPE_COORDS_SIZE) { |
172 |
buf = setAreaOfInterest(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), |
|
173 |
q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight()); |
|
182 |
buf = setAreaOfInterestInWC(q); |
|
174 | 183 |
buf.setDataExtent(new Rectangle2D.Double(q.getBBox().getULX(), q.getBBox().getULY(), |
175 | 184 |
q.getBBox().getLRX() - q.getBBox().getULX(), q.getBBox().getLRY() - q.getBBox().getULY())); |
176 | 185 |
} |
177 | 186 |
|
187 |
//***************************************** |
|
188 |
//Tiled |
|
189 |
//***************************************** |
|
178 | 190 |
if(q.getType() == DefaultRasterQuery.TYPE_COORDS_SIZE_TILED) { |
179 |
setAreaOfInterest(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), |
|
180 |
q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight(), q.getTileListener()); |
|
191 |
step = null; |
|
192 |
dataExtent = new ExtentImpl(q.getBBox().getULX(), q.getBBox().getULY(), |
|
193 |
q.getBBox().getLRX(), q.getBBox().getLRY()); |
|
194 |
((RasterDataParameters)getParameters()).setAlphaBand(currentQuery.getAlphaBandNumber()); |
|
195 |
getWindow(q.getBBox().getULX(), q.getBBox().getULY(), |
|
196 |
q.getBBox().getLRX(), q.getBBox().getLRY(), |
|
197 |
q.getBufWidth(), q.getBufHeight(), |
|
198 |
q.getTileListener()); |
|
181 | 199 |
} |
182 | 200 |
|
183 |
if(q.getType() == DefaultRasterQuery.TYPE_PX) |
|
184 |
buf = setAreaOfInterest(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH()); |
|
201 |
//***************************************** |
|
202 |
//Pixel coordinates with and without resampling |
|
203 |
//***************************************** |
|
204 |
if(q.getType() == DefaultRasterQuery.TYPE_PX || q.getType() == DefaultRasterQuery.TYPE_PX_SIZE) { |
|
205 |
buf = setAreaOfInterestInPx(q); |
|
206 |
} |
|
185 | 207 |
|
186 |
if(q.getType() == DefaultRasterQuery.TYPE_PX_SIZE) |
|
187 |
buf = setAreaOfInterest(q.getPixelX(), q.getPixelY(), q.getPixelW(), |
|
188 |
q.getPixelH(), q.getBufWidth(), q.getBufHeight()); |
|
189 |
|
|
190 | 208 |
result = new Object[]{buf}; |
191 | 209 |
|
210 |
//***************************************** |
|
211 |
//Request only one tile |
|
212 |
//***************************************** |
|
192 | 213 |
if(q.getType() == DefaultRasterQuery.TYPE_ONE_TILE) { |
193 | 214 |
if(isTiled()) { |
194 | 215 |
try { |
... | ... | |
198 | 219 |
throw new RasterDriverException("Problems getting the tile", e); |
199 | 220 |
} |
200 | 221 |
} else { |
201 |
buf = setAreaOfInterest(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), |
|
202 |
q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight()); |
|
222 |
buf = setAreaOfInterestInWC(q); |
|
203 | 223 |
buf.setDataExtent(new Rectangle2D.Double(q.getBBox().getULX(), q.getBBox().getULY(), |
204 | 224 |
q.getBBox().getLRX() - q.getBBox().getULX(), q.getBBox().getLRY() - q.getBBox().getULY())); |
205 | 225 |
result = new Object[]{buf}; |
... | ... | |
221 | 241 |
return null; |
222 | 242 |
} |
223 | 243 |
|
224 |
/* |
|
225 |
* (non-Javadoc) |
|
226 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getAdjustedToExtent(org.gvsig.fmap.dal.coverage.datastruct.Extent) |
|
227 |
*/ |
|
228 |
public Extent adjustToExtent(Extent e) { |
|
229 |
Extent currentExtent = this.getExtent(); |
|
230 |
|
|
231 |
double minx = e.getMin().getX() < currentExtent.getMin().getX() ? currentExtent.getMin().getX() : e.getMin().getX(); |
|
232 |
double maxx = e.getMax().getX() > currentExtent.getMax().getX() ? currentExtent.getMax().getX() : e.getMax().getX(); |
|
233 |
double miny = e.getMin().getY() < currentExtent.getMin().getY() ? currentExtent.getMin().getY() : e.getMin().getY(); |
|
234 |
double maxy = e.getMax().getY() > currentExtent.getMax().getY() ? currentExtent.getMax().getY() : e.getMax().getY(); |
|
235 |
|
|
236 |
return new ExtentImpl(minx, maxy, maxx, miny); |
|
237 |
} |
|
238 |
|
|
239 |
public String getFullName() { |
|
240 |
return getName(); |
|
241 |
} |
|
242 |
|
|
243 |
/* |
|
244 |
* (non-Javadoc) |
|
245 |
* @see org.gvsig.fmap.dal.coverage.buffer.RasterDataSource#getLastBuffer() |
|
246 |
*/ |
|
247 |
public Buffer getLastBuffer() { |
|
248 |
return lastBuffer; |
|
249 |
} |
|
250 |
|
|
251 |
/* |
|
252 |
* (non-Javadoc) |
|
253 |
* @see org.gvsig.fmap.dal.coverage.buffer.RasterDataSource#getStep() |
|
254 |
*/ |
|
255 |
public double[] getStep() { |
|
256 |
return step; |
|
257 |
} |
|
258 |
|
|
259 |
|
|
260 | 244 |
/** |
261 |
* Asigna el ?rea de inter?s a toda la extensi?n del raster. |
|
262 |
*/ |
|
263 |
protected Buffer setAreaOfInterest() |
|
264 |
throws ProcessInterruptedException, InvalidSetViewException, RasterDriverException { |
|
265 |
step = null; |
|
266 |
dataExtent = getExtent(); |
|
267 |
return getWindow(0, 0, (int)getWidth(), (int)getHeight()); |
|
268 |
} |
|
269 |
|
|
270 |
/** |
|
271 | 245 |
* Asigna el ?rea de interes en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen |
272 | 246 |
* estas coordenadas son ajustadas el extent. |
273 | 247 |
* @param x Coordenada X, esquina superior izquierda |
... | ... | |
277 | 251 |
* @throws ArrayIndexOutOfBoundsException |
278 | 252 |
* @throws InvalidSetViewException |
279 | 253 |
*/ |
280 |
protected Buffer setAreaOfInterest(double x, double y, double w, double h)
|
|
254 |
protected Buffer setAreaOfInterestInWC(DefaultRasterQuery q)
|
|
281 | 255 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
282 |
step = null; |
|
283 |
dataExtent = new ExtentImpl(x, y, x + w, y - h); |
|
284 |
|
|
285 |
Extent adjustedDataExtent = util.calculateAdjustedView(dataExtent, getAffineTransform(), getWidth(), getHeight()); |
|
286 |
|
|
287 |
return getWindow(adjustedDataExtent.getMin().getX(), adjustedDataExtent.getMax().getY(), adjustedDataExtent.width(), adjustedDataExtent.height(), currentQuery.isAdjustToExtent()); |
|
288 |
} |
|
289 |
|
|
290 |
public void setAreaOfInterest(double ulx, double uly, double lrx, double lry, |
|
291 |
int bufWidth, int bufHeight, TileListener listener) throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
|
292 |
step = null; |
|
293 |
dataExtent = new ExtentImpl(ulx, uly, lrx, lry); |
|
294 |
((RasterDataParameters)getParameters()).setAlphaBand(currentQuery.getAlphaBandNumber()); |
|
295 |
getWindow(ulx, uly, lrx, lry, bufWidth, bufHeight, listener); |
|
296 |
} |
|
297 |
|
|
298 |
/** |
|
299 |
* Asigna el ?rea de inter?s en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen |
|
300 |
* estas coordenadas son ajustadas el extent. |
|
301 |
* @param x Coordenada X, esquina superior izquierda |
|
302 |
* @param y Coordenada Y, esquina superior izquierda |
|
303 |
* @param w Ancho del ?rea |
|
304 |
* @param h Alto del ?rea |
|
305 |
* @param bufWidth Ancho del buffer |
|
306 |
* @param bufHeight Alto del buffer |
|
307 |
* @return En caso de que el buffer sea mayor que el tama?o seleccionado de raster se produce supersampleo. La funci?n devuelve |
|
308 |
* un array de dos elementos que representan el desplazamiento en pixels de X e Y de la esquina superior izquierda. |
|
309 |
* @throws ArrayIndexOutOfBoundsException |
|
310 |
* @throws InvalidSetViewException |
|
311 |
*/ |
|
312 |
protected Buffer setAreaOfInterest(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight) |
|
313 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
|
314 |
step = null; |
|
315 |
dataExtent = new ExtentImpl(ulx, uly, lrx, lry); |
|
316 |
Extent adjustedDataExtent = util.calculateAdjustedView(dataExtent, getAffineTransform(), getWidth(), getHeight()); |
|
317 |
|
|
318 |
//Caso 3D: La petici?n no se ajusta al ?rea y se rellena el exterior con NoData |
|
319 |
if(!currentQuery.isAdjustToExtent() && !util.isInside(dataExtent, getExtent())) { |
|
320 |
return requestFillingWithNoData(dataExtent, adjustedDataExtent, bufWidth, bufHeight); |
|
256 |
if(q.getType() == DefaultRasterQuery.TYPE_COORDS) { |
|
257 |
step = null; |
|
258 |
dataExtent = new ExtentImpl(q.getX(), q.getY(), q.getX() + q.getW(), q.getY() - q.getH()); |
|
259 |
Extent adjustedDataExtent = util.calculateAdjustedView(dataExtent, getAffineTransform(), getWidth(), getHeight()); |
|
260 |
return getWindow(adjustedDataExtent.getMin().getX(), adjustedDataExtent.getMax().getY(), adjustedDataExtent.width(), adjustedDataExtent.height(), currentQuery.isAdjustToExtent()); |
|
321 | 261 |
} |
322 | 262 |
|
323 |
//Esta secci?n es para que no supersamplee el driver y pueda hacerse en el cliente |
|
324 |
if(!currentQuery.isSupersamplingLoadingBuffer()) { |
|
325 |
Point2D p1 = worldToRaster(new Point2D.Double(adjustedDataExtent.getULX(), adjustedDataExtent.getULY())); |
|
326 |
Point2D p2 = worldToRaster(new Point2D.Double(adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY())); |
|
327 |
nWidth = Math.abs(p1.getX() - p2.getX()); |
|
328 |
nHeight = Math.abs(p1.getY() - p2.getY()); |
|
263 |
if( q.getType() == DefaultRasterQuery.TYPE_COORDS_SIZE || |
|
264 |
q.getType() == DefaultRasterQuery.TYPE_ONE_TILE) { |
|
265 |
step = null; |
|
266 |
dataExtent = new ExtentImpl(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY()); |
|
267 |
Extent adjustedDataExtent = util.calculateAdjustedView(dataExtent, getAffineTransform(), getWidth(), getHeight()); |
|
329 | 268 |
|
330 |
if(bufWidth > Math.ceil(nWidth) && bufHeight > Math.ceil(nHeight)) {
|
|
331 |
step = calcSteps(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY(), nWidth, nHeight, bufWidth, bufHeight);
|
|
332 |
return getWindow(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY());
|
|
269 |
//Caso 3D: La petici?n no se ajusta al ?rea y se rellena el exterior con NoData
|
|
270 |
if(!currentQuery.isAdjustToExtent() && !util.isInside(dataExtent, getExtent())) {
|
|
271 |
return requestFillingWithNoData(dataExtent, adjustedDataExtent, q.getBufWidth(), q.getBufHeight());
|
|
333 | 272 |
} |
273 |
|
|
274 |
//Esta secci?n es para que no supersamplee el driver y pueda hacerse en el cliente |
|
275 |
if(!currentQuery.isSupersamplingLoadingBuffer()) { |
|
276 |
Point2D p1 = worldToRaster(new Point2D.Double(adjustedDataExtent.getULX(), adjustedDataExtent.getULY())); |
|
277 |
Point2D p2 = worldToRaster(new Point2D.Double(adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY())); |
|
278 |
nWidth = Math.abs(p1.getX() - p2.getX()); |
|
279 |
nHeight = Math.abs(p1.getY() - p2.getY()); |
|
280 |
|
|
281 |
if(q.getBufWidth() > Math.ceil(nWidth) && q.getBufHeight() > Math.ceil(nHeight)) { |
|
282 |
step = calcSteps(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY(), nWidth, nHeight, q.getBufWidth(), q.getBufHeight()); |
|
283 |
return getWindow(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY()); |
|
284 |
} |
|
285 |
} |
|
286 |
return getWindow(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY(), q.getBufWidth(), q.getBufHeight(), true /*Siempre ajustado*/); |
|
334 | 287 |
} |
335 |
return getWindow(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY(), bufWidth, bufHeight, true /*Siempre ajustado*/);
|
|
288 |
return null;
|
|
336 | 289 |
} |
337 | 290 |
|
338 | 291 |
/** |
339 |
* Asigna el ?rea de interes en coordenadas pixel. Si las coordenadas exceden del tama?o de la imagen |
|
340 |
* lanza una excepci?n. |
|
341 |
* @param x Coordenada X, esquina superior izquierda |
|
342 |
* @param y Coordenada Y, esquina superior izquierda |
|
343 |
* @param w Ancho del ?rea |
|
344 |
* @param h Alto del ?rea |
|
345 |
* @throws InvalidSetViewException |
|
346 |
* @throws ArrayIndexOutOfBoundsException |
|
347 |
*/ |
|
348 |
protected Buffer setAreaOfInterest(int x, int y, int w, int h) |
|
349 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
350 |
step = null; |
|
351 |
if(x > getSourceWidth() || y > getSourceHeight()) |
|
352 |
throw new InvalidSetViewException("Wrong parameters in setAreaOfInterest"); |
|
353 |
x = (x < 0) ? 0 : x; |
|
354 |
y = (y < 0) ? 0 : y; |
|
355 |
w = (w > getSourceWidth()) ? getSourceWidth() : w; |
|
356 |
h = (h > getSourceHeight()) ? getSourceHeight() : h; |
|
357 |
|
|
358 |
dataExtent = new ExtentImpl(rasterToWorld(new Point2D.Double(x, y)), |
|
359 |
rasterToWorld(new Point2D.Double(x + w, y + h))); |
|
360 |
return getWindow(x, y, w, h); |
|
361 |
} |
|
362 |
|
|
363 |
/** |
|
364 | 292 |
* Asigna el ?rea de interes en coordenadas pixel. Esta operaci?n cargar? un RasterBuffer con los datos solicitados por |
365 | 293 |
* lo que, si al acabar hacemos getRasterBuf obtendremos la matriz de datos. Si las coordenadas exceden del tama�o |
366 | 294 |
* de la imagen lanza una excepci?n. |
... | ... | |
372 | 300 |
* @param bufHeight Alto del buffer |
373 | 301 |
* @throws ArrayIndexOutOfBoundsException |
374 | 302 |
*/ |
375 |
protected Buffer setAreaOfInterest(int x, int y, int w, int h, int bufWidth, int bufHeight)
|
|
303 |
protected Buffer setAreaOfInterestInPx(DefaultRasterQuery q)
|
|
376 | 304 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
377 | 305 |
step = null; |
378 |
if(x > getSourceWidth() || y > getSourceHeight())
|
|
306 |
if(q.getPixelX() > getSourceWidth() || q.getPixelY() > getSourceHeight())
|
|
379 | 307 |
throw new InvalidSetViewException("Wrong parameters in setAreaOfInterest"); |
380 | 308 |
|
381 |
x = (x < 0) ? 0 : x;
|
|
382 |
y = (y < 0) ? 0 : y;
|
|
383 |
w = (w > getSourceWidth()) ? getSourceWidth() : w;
|
|
384 |
h = (h > getSourceHeight()) ? getSourceHeight() : h;
|
|
309 |
int x = (q.getPixelX() < 0) ? 0 : q.getPixelX();
|
|
310 |
int y = (q.getPixelY() < 0) ? 0 : q.getPixelY();
|
|
311 |
int w = (q.getPixelW() > getSourceWidth()) ? getSourceWidth() : q.getPixelW();
|
|
312 |
int h = (q.getPixelH() > getSourceHeight()) ? getSourceHeight() : q.getPixelH();
|
|
385 | 313 |
|
386 | 314 |
dataExtent = new ExtentImpl(rasterToWorld(new Point2D.Double(x, y)), |
387 |
rasterToWorld(new Point2D.Double(x + w, y + h))); |
|
388 |
|
|
389 |
return getWindow(x, y, w, h, bufWidth, bufHeight); |
|
315 |
rasterToWorld(new Point2D.Double(x + w, y + h))); |
|
316 |
|
|
317 |
if(q.getType() == DefaultRasterQuery.TYPE_PX) |
|
318 |
return getWindow(x, y, w, h, -1, -1); |
|
319 |
if(q.getType() == DefaultRasterQuery.TYPE_PX_SIZE) |
|
320 |
return getWindow(x, y, w, h, q.getBufWidth(), q.getBufHeight()); |
|
321 |
return null; |
|
390 | 322 |
} |
391 |
|
|
392 | 323 |
|
324 |
/* |
|
325 |
* (non-Javadoc) |
|
326 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getAdjustedToExtent(org.gvsig.fmap.dal.coverage.datastruct.Extent) |
|
327 |
*/ |
|
328 |
public Extent adjustToExtent(Extent e) { |
|
329 |
Extent currentExtent = this.getExtent(); |
|
330 |
|
|
331 |
double minx = e.getMin().getX() < currentExtent.getMin().getX() ? currentExtent.getMin().getX() : e.getMin().getX(); |
|
332 |
double maxx = e.getMax().getX() > currentExtent.getMax().getX() ? currentExtent.getMax().getX() : e.getMax().getX(); |
|
333 |
double miny = e.getMin().getY() < currentExtent.getMin().getY() ? currentExtent.getMin().getY() : e.getMin().getY(); |
|
334 |
double maxy = e.getMax().getY() > currentExtent.getMax().getY() ? currentExtent.getMax().getY() : e.getMax().getY(); |
|
335 |
|
|
336 |
return new ExtentImpl(minx, maxy, maxx, miny); |
|
337 |
} |
|
338 |
|
|
339 |
public String getFullName() { |
|
340 |
return getName(); |
|
341 |
} |
|
342 |
|
|
343 |
/* |
|
344 |
* (non-Javadoc) |
|
345 |
* @see org.gvsig.fmap.dal.coverage.buffer.RasterDataSource#getLastBuffer() |
|
346 |
*/ |
|
347 |
public Buffer getLastBuffer() { |
|
348 |
return lastBuffer; |
|
349 |
} |
|
350 |
|
|
351 |
/* |
|
352 |
* (non-Javadoc) |
|
353 |
* @see org.gvsig.fmap.dal.coverage.buffer.RasterDataSource#getStep() |
|
354 |
*/ |
|
355 |
public double[] getStep() { |
|
356 |
return step; |
|
357 |
} |
|
358 |
|
|
393 | 359 |
/** |
394 | 360 |
* Para este GeoRasterFile asigna que bandas se pintaran |
395 | 361 |
* sobre el RasterBuf cuando se haga un update. Cada posici?n del vector es una banda |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRemoteRasterStore.java | ||
---|---|---|
46 | 46 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
47 | 47 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
48 | 48 |
import org.gvsig.raster.impl.DefaultRasterManager; |
49 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
|
49 | 50 |
import org.gvsig.raster.impl.datastruct.BandListImpl; |
50 | 51 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
51 | 52 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
... | ... | |
101 | 102 |
return null; |
102 | 103 |
} |
103 | 104 |
} |
104 |
|
|
105 |
/* |
|
106 |
* (non-Javadoc) |
|
107 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#setAreaOfInterest() |
|
108 |
*/ |
|
109 |
@Override |
|
110 |
protected Buffer setAreaOfInterest() |
|
111 |
throws ProcessInterruptedException, InvalidSetViewException, RasterDriverException { |
|
112 |
return getWindow(0, 0, (int)getWidth(), (int)getHeight()); |
|
113 |
} |
|
114 | 105 |
|
115 | 106 |
/* |
116 | 107 |
* (non-Javadoc) |
117 | 108 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#setAreaOfInterest(double, double, double, double) |
118 | 109 |
*/ |
119 | 110 |
@Override |
120 |
protected Buffer setAreaOfInterest(double x, double y, double w, double h)
|
|
111 |
protected Buffer setAreaOfInterestInWC(DefaultRasterQuery q)
|
|
121 | 112 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
122 |
return getWindow(x, y, w, h, currentQuery.isAdjustToExtent()); |
|
113 |
if(q.getType() == DefaultRasterQuery.TYPE_COORDS) { |
|
114 |
return getWindow(q.getX(), q.getY(), q.getW(), q.getH(), currentQuery.isAdjustToExtent()); |
|
115 |
} |
|
116 |
|
|
117 |
if( q.getType() == DefaultRasterQuery.TYPE_COORDS_SIZE || |
|
118 |
q.getType() == DefaultRasterQuery.TYPE_ONE_TILE) { |
|
119 |
if(getParameters() instanceof RemoteStoreParameters && ((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
120 |
return super.getWindow(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight(), true); |
|
121 |
else |
|
122 |
return getWindow(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight(), true); |
|
123 |
} |
|
124 |
|
|
125 |
return null; |
|
123 | 126 |
} |
124 | 127 |
|
125 | 128 |
/* |
126 | 129 |
* (non-Javadoc) |
127 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#setAreaOfInterest(double, double, double, double, int, int) |
|
128 |
*/ |
|
129 |
@Override |
|
130 |
protected Buffer setAreaOfInterest(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight) |
|
131 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
|
132 |
if(getParameters() instanceof RemoteStoreParameters && ((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
133 |
return super.getWindow(ulx, uly, lrx, lry, bufWidth, bufHeight, true); |
|
134 |
else |
|
135 |
return getWindow(ulx, uly, lrx, lry, bufWidth, bufHeight, true); |
|
136 |
} |
|
137 |
|
|
138 |
/* |
|
139 |
* (non-Javadoc) |
|
140 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#setAreaOfInterest(int, int, int, int) |
|
141 |
*/ |
|
142 |
@Override |
|
143 |
protected Buffer setAreaOfInterest(int x, int y, int w, int h) |
|
144 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
145 |
if(((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
146 |
return super.getWindow(x, y, w, h); |
|
147 |
else |
|
148 |
return getWindow(x, y, w, h); |
|
149 |
} |
|
150 |
|
|
151 |
/* |
|
152 |
* (non-Javadoc) |
|
153 | 130 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#setAreaOfInterest(int, int, int, int, int, int) |
154 | 131 |
*/ |
155 | 132 |
@Override |
156 |
protected Buffer setAreaOfInterest(int x, int y, int w, int h, int bufWidth, int bufHeight) |
|
157 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
158 |
if(((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
159 |
return super.getWindow(x, y, w, h, bufWidth, bufHeight); |
|
160 |
else |
|
161 |
return getWindow(x, y, w, h, bufWidth, bufHeight); |
|
133 |
protected Buffer setAreaOfInterestInPx(DefaultRasterQuery q) |
|
134 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
135 |
if(q.getType() == DefaultRasterQuery.TYPE_PX) { |
|
136 |
if(((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
137 |
return super.getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH()); |
|
138 |
else |
|
139 |
return getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH()); |
|
140 |
} |
|
141 |
if(q.getType() == DefaultRasterQuery.TYPE_PX_SIZE) { |
|
142 |
if(((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
143 |
return super.getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH(), q.getBufWidth(), q.getBufHeight()); |
|
144 |
else |
|
145 |
return getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH(), q.getBufWidth(), q.getBufHeight()); |
|
146 |
} |
|
147 |
return null; |
|
162 | 148 |
} |
163 |
|
|
149 |
|
|
164 | 150 |
/* |
165 | 151 |
* (non-Javadoc) |
166 | 152 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double) |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/DefaultRender.java | ||
---|---|---|
72 | 72 |
import org.gvsig.tools.persistence.Persistent; |
73 | 73 |
import org.gvsig.tools.persistence.PersistentState; |
74 | 74 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
75 |
import org.gvsig.tools.task.TaskStatus; |
|
75 | 76 |
import org.slf4j.LoggerFactory; |
76 | 77 |
/** |
77 | 78 |
* Esta clase se encarga de la gesti?n del dibujado de datos le?dos desde la capa |
... | ... | |
256 | 257 |
*/ |
257 | 258 |
public void run() { |
258 | 259 |
try { |
259 |
draw(lastGraphics, lastViewPortData); |
|
260 |
draw(lastGraphics, lastViewPortData, null);
|
|
260 | 261 |
} catch (RasterDriverException e) { |
261 | 262 |
LoggerFactory.getLogger(getClass()).debug("Error reading data", e); |
262 | 263 |
} catch (InvalidSetViewException e) { |
... | ... | |
300 | 301 |
* (non-Javadoc) |
301 | 302 |
* @see org.gvsig.fmap.dal.coverage.grid.render.Render#draw(java.awt.Graphics2D, org.cresques.geo.ViewPortData) |
302 | 303 |
*/ |
303 |
public synchronized void drawTiledService(Graphics2D g, ViewPortData vp, Dimension2D viewDimension) |
|
304 |
public synchronized void drawTiledService(Graphics2D g, |
|
305 |
ViewPortData vp, |
|
306 |
Dimension2D viewDimension, |
|
307 |
TaskStatus taskStatus) |
|
304 | 308 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
305 | 309 |
lastGraphics = g; |
306 | 310 |
lastViewPortData = vp; |
307 |
this. viewDimension = viewDimension;
|
|
311 |
this.viewDimension = viewDimension;
|
|
308 | 312 |
|
309 | 313 |
if(util.isOutside(vp.getExtent(), dataStore.getExtent())) { |
310 | 314 |
endReading(); |
... | ... | |
322 | 326 |
|
323 | 327 |
// Asignamos la banda de transparencia si existe esta |
324 | 328 |
RasterQuery query = DefaultRasterManager.getInstance().createQuery(); |
329 |
query.setTaskStatus(taskStatus); |
|
325 | 330 |
query.setTime(vp.getTime()); |
326 | 331 |
query.setSupersamplingLoadingBuffer(false); // Desactivamos el supersampleo en la carga del buffer. |
327 | 332 |
query.setDrawableBands(getRenderBands()); |
... | ... | |
340 | 345 |
* (non-Javadoc) |
341 | 346 |
* @see org.gvsig.fmap.dal.coverage.grid.render.Render#draw(java.awt.Graphics2D, org.cresques.geo.ViewPortData) |
342 | 347 |
*/ |
343 |
public synchronized void draw(Graphics2D g, ViewPortData vp) |
|
348 |
public synchronized void draw(Graphics2D g, ViewPortData vp, TaskStatus taskStatus)
|
|
344 | 349 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
345 | 350 |
lastGraphics = g; |
346 | 351 |
lastViewPortData = vp; |
... | ... | |
367 | 372 |
} |
368 | 373 |
// Asignamos la banda de transparencia si existe esta |
369 | 374 |
RasterQuery query = DefaultRasterManager.getInstance().createQuery(); |
375 |
query.setTaskStatus(taskStatus); |
|
370 | 376 |
query.setTime(vp.getTime()); |
371 | 377 |
query.setSupersamplingLoadingBuffer(false); // Desactivamos el supersampleo en la carga del buffer. |
372 | 378 |
query.setAreaOfInterest(adjustedRotedRequest, (int)Math.round(widthImage), (int)Math.round(heightImage)); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultRasterQuery.java | ||
---|---|---|
30 | 30 |
import org.gvsig.timesupport.Time; |
31 | 31 |
import org.gvsig.tools.persistence.PersistentState; |
32 | 32 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
33 |
import org.gvsig.tools.task.TaskStatus; |
|
33 | 34 |
|
34 | 35 |
/** |
35 | 36 |
* Default implementation for RasterQuery |
... | ... | |
86 | 87 |
private int tileRow = 0; |
87 | 88 |
private int tileCol = 0; |
88 | 89 |
private CacheStruct cacheStruct = null; |
90 |
private TaskStatus taskStatus = null; |
|
89 | 91 |
|
90 | 92 |
/* |
91 | 93 |
* (non-Javadoc) |
... | ... | |
400 | 402 |
return resolutionLevel; |
401 | 403 |
} |
402 | 404 |
|
405 |
/* |
|
406 |
* (non-Javadoc) |
|
407 |
* @see org.gvsig.fmap.dal.coverage.store.RasterQuery#setTaskStatus(org.gvsig.tools.task.TaskStatus) |
|
408 |
*/ |
|
409 |
public void setTaskStatus(TaskStatus taskStatus) { |
|
410 |
this.taskStatus = taskStatus; |
|
411 |
} |
|
412 |
|
|
413 |
/** |
|
414 |
* Gets the task status |
|
415 |
*/ |
|
416 |
public TaskStatus getTaskStatus() { |
|
417 |
return taskStatus; |
|
418 |
} |
|
419 |
|
|
403 | 420 |
//**************************************************** |
404 | 421 |
//*********Implementing DataQuery methods************* |
405 | 422 |
//**************************************************** |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.app/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/layer/FLyrWMS.java | ||
---|---|---|
102 | 102 |
import org.gvsig.tools.persistence.PersistentState; |
103 | 103 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
104 | 104 |
import org.gvsig.tools.task.Cancellable; |
105 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
106 |
import org.gvsig.tools.task.TaskStatusManager; |
|
105 | 107 |
import org.slf4j.Logger; |
106 | 108 |
import org.slf4j.LoggerFactory; |
107 | 109 |
|
... | ... | |
419 | 421 |
getParameters().setHeight(hImg); |
420 | 422 |
} |
421 | 423 |
getParameters().setCancellable(cancel); |
422 |
if(params instanceof WMSDataParameters) |
|
423 |
getRender().draw(g, vpData); |
|
424 |
else |
|
425 |
getRender().drawTiledService(g, vpData, vp.getImageSize()); |
|
424 |
|
|
425 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
426 |
SimpleTaskStatus taskStatus = manager.createDefaultSimpleTaskStatus("Drawing " + getName() + "..."); |
|
427 |
manager.add(taskStatus); |
|
428 |
|
|
429 |
if(params instanceof WMSDataParameters) { |
|
430 |
getRender().draw(g, vpData, taskStatus); |
|
431 |
taskStatus.terminate(); |
|
432 |
} else |
|
433 |
getRender().drawTiledService(g, vpData, vp.getImageSize(), taskStatus); |
|
426 | 434 |
//this.updateDrawVersion(); |
427 | 435 |
} catch (RasterDriverException e) { |
428 | 436 |
throw new RemoteServiceException("Problems drawing this layer: " + e.getMessage(), e); |
... | ... | |
708 | 716 |
|
709 | 717 |
public Image getImageLegend() { |
710 | 718 |
/*try { |
719 |
getParameters().getOnlineResource() |
|
711 | 720 |
if (wms == null) { |
712 | 721 |
wms = getDriver(); |
713 | 722 |
} |
org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.app/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java | ||
---|---|---|
93 | 93 |
import org.gvsig.tools.persistence.PersistentState; |
94 | 94 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
95 | 95 |
import org.gvsig.tools.task.Cancellable; |
96 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
97 |
import org.gvsig.tools.task.TaskStatusManager; |
|
96 | 98 |
import org.slf4j.Logger; |
97 | 99 |
import org.slf4j.LoggerFactory; |
98 | 100 |
|
... | ... | |
339 | 341 |
par.setWidth((int)viewPort.getImageSize().getWidth()); |
340 | 342 |
par.setHeight((int)viewPort.getImageSize().getHeight()); |
341 | 343 |
|
342 |
getRender().drawTiledService(g, vp2, viewPort.getImageSize()); |
|
344 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
345 |
SimpleTaskStatus taskStatus = manager.createDefaultSimpleTaskStatus("Drawing " + getName() + "..."); |
|
346 |
manager.add(taskStatus); |
|
347 |
|
|
348 |
getRender().drawTiledService(g, vp2, viewPort.getImageSize(), taskStatus); |
|
343 | 349 |
} catch (RasterDriverException e) { |
344 | 350 |
throw new ReadException("Problems drawing this layer: " + e.getMessage(), e); |
345 | 351 |
} catch (InvalidSetViewException e) { |
org.gvsig.raster.wcs/trunk/org.gvsig.raster.wcs/org.gvsig.raster.wcs.app/org.gvsig.raster.wcs.app.wcsclient/src/main/java/org/gvsig/raster/wcs/app/wcsclient/layer/FLyrWCS.java | ||
---|---|---|
106 | 106 |
import org.gvsig.tools.persistence.PersistentState; |
107 | 107 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
108 | 108 |
import org.gvsig.tools.task.Cancellable; |
109 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
110 |
import org.gvsig.tools.task.TaskStatusManager; |
|
109 | 111 |
import org.slf4j.Logger; |
110 | 112 |
import org.slf4j.LoggerFactory; |
111 | 113 |
|
... | ... | |
353 | 355 |
vpData.setMat(vp.getAffineTransform()); |
354 | 356 |
|
355 | 357 |
try { |
358 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
359 |
SimpleTaskStatus taskStatus = manager.createDefaultSimpleTaskStatus("Drawing " + getName() + "..."); |
|
360 |
manager.add(taskStatus); |
|
361 |
|
|
356 | 362 |
getParameters().setExtent(bBox); |
357 | 363 |
getParameters().setWidth(wImg); |
358 | 364 |
getParameters().setHeight(hImg); |
359 | 365 |
getParameters().setCancellable(cancel); |
360 |
if(params instanceof WCSDataParameters) |
|
361 |
getRender().draw(g, vpData); |
|
362 |
else |
|
363 |
getRender().drawTiledService(g, vpData, vp.getImageSize()); |
|
366 |
if(params instanceof WCSDataParameters) { |
|
367 |
getRender().draw(g, vpData, taskStatus); |
|
368 |
taskStatus.terminate(); |
|
369 |
} else |
|
370 |
getRender().drawTiledService(g, vpData, vp.getImageSize(), taskStatus); |
|
364 | 371 |
} catch (RasterDriverException e) { |
365 | 372 |
throw new RemoteServiceException("Problems drawing this layer: " + e.getMessage(), e); |
366 | 373 |
} catch (InvalidSetViewException e) { |
Also available in: Unified diff