Revision 11067 trunk/libraries/libRaster/src/org/gvsig/raster/dataaccess/cache/PageBuffer.java
PageBuffer.java | ||
---|---|---|
37 | 37 |
*/ |
38 | 38 |
public class PageBuffer implements IBuffer { |
39 | 39 |
|
40 |
private PageBandBuffer[] pageBandBuffer = null; |
|
41 |
private int percent = 0; |
|
40 |
private PageBandBuffer[] pageBandBuffer = null; |
|
41 |
|
|
42 |
private int percent = 0; |
|
43 |
private boolean canceled = false; |
|
42 | 44 |
|
43 | 45 |
/** |
44 | 46 |
* Constructor |
... | ... | |
420 | 422 |
return null; |
421 | 423 |
Histogram hist = new Histogram(getBandCount(), 256); |
422 | 424 |
for (int iBand = 0; iBand < getBandCount(); iBand++) |
423 |
for (int col = 0; col < getHeight(); col++) |
|
425 |
for (int col = 0; col < getHeight(); col++) {
|
|
424 | 426 |
for (int row = 0; row < getWidth(); row++) |
425 | 427 |
hist.incrementPxValue(iBand, getElemByte(row, col, iBand)); |
428 |
if (isCanceled()) return null; |
|
429 |
} |
|
426 | 430 |
percent = 100; |
427 | 431 |
return hist; |
428 | 432 |
} |
... | ... | |
467 | 471 |
public int getPercent() { |
468 | 472 |
return percent; |
469 | 473 |
} |
474 |
|
|
475 |
/* |
|
476 |
* (non-Javadoc) |
|
477 |
* @see org.gvsig.raster.util.ICancellable#cancel() |
|
478 |
*/ |
|
479 |
public void cancel() { |
|
480 |
canceled = true; |
|
481 |
} |
|
482 |
|
|
483 |
/* |
|
484 |
* (non-Javadoc) |
|
485 |
* @see org.gvsig.raster.util.ICancellable#isCanceled() |
|
486 |
*/ |
|
487 |
public boolean isCanceled() { |
|
488 |
return canceled; |
|
489 |
} |
|
470 | 490 |
} |
Also available in: Unified diff