Revision 11067 trunk/libraries/libRaster/src/org/gvsig/raster/dataaccess/buffer/RasterBuffer.java

View differences:

RasterBuffer.java
45 45
	private static int		multicacheMemorySize = 100;
46 46
	
47 47
	public double 			noDataValue = -99999;
48
	protected int			percent = 0;
48

  
49
	protected int				percent = 0;
50
	protected boolean		canceled = false;
49 51
	
50 52
  protected int 			width;
51 53
  protected int 			height;
......
384 386
			for (int row = 0; row < getHeight(); row++) {
385 387
				for (int col = 0; col < getWidth(); col++) 
386 388
					hist.incrementPxValue(iBand, (getElemByte(row, col, iBand) & 0xff));
389
				if (isCanceled()) return null;
387 390
				percent = ((iBand*getHeight() + row) * 100) /(getHeight() * getBandCount());
388 391
			}
389 392
		percent = 100;
......
430 433
	public int getPercent() {
431 434
		return percent;
432 435
	}
436

  
437
	/*
438
	 * (non-Javadoc)
439
	 * @see org.gvsig.raster.util.ICancellable#isCanceled()
440
	 */
441
	public boolean isCanceled() {
442
		return canceled;
443
	}
444
	
445
	/*
446
	 * (non-Javadoc)
447
	 * @see org.gvsig.raster.util.ICancellable#cancel()
448
	 */
449
	public void cancel() {
450
		canceled = true;
451
	}
433 452
}

Also available in: Unified diff