Revision 11084 trunk/extensions/extRasterTools-SE/src/org/gvsig/fmap/drivers/raster/RasterSEDriver.java

View differences:

RasterSEDriver.java
31 31
import org.cresques.cts.ICoordTrans;
32 32
import org.cresques.cts.IProjection;
33 33
import org.gvsig.fmap.drivers.GeoRasterDriver;
34
import org.gvsig.raster.dataaccess.DataSource;
34
import org.gvsig.raster.buffer.BufferFactory;
35 35
import org.gvsig.raster.dataset.NotSupportedExtensionException;
36 36
import org.gvsig.raster.dataset.RasterDataset;
37 37
import org.gvsig.raster.dataset.RasterDriverException;
......
49 49
	private IProjection proj = null;
50 50
	private RasterDataset dataset = null;
51 51
	private Rendering render = null;
52
	private DataSource	ds = null;
52
	private BufferFactory	bf = null;
53 53

  
54 54
	int trans = 255;
55 55

  
......
95 95
			//TODO: FUNCIONALIDAD: Manejar las excepciones para que informen convenientemente
96 96
			
97 97
			try {
98
				dataset = RasterDataset.openFile(proj, fName);
98
				dataset = RasterDataset.open(proj, fName);
99 99
			} catch (NotSupportedExtensionException e) {
100 100
				throw new IOException("Formato no valido");
101 101
			} catch (RasterDriverException e) {
......
103 103
			}
104 104
			if(dataset == null)
105 105
				throw new IOException("Formato no valido");
106
			ds = new DataSource(dataset);
106
			bf = new BufferFactory(dataset);
107 107
			createRender();
108 108
		} else
109 109
			throw new IOException("Proyecci?n no asignada");
......
116 116
	public void initialize(IProjection proj) throws IOException {
117 117
		this.proj = proj;
118 118
		try{
119
			dataset = RasterDataset.openFile(proj, file.getAbsolutePath());
119
			dataset = RasterDataset.open(proj, file.getAbsolutePath());
120 120
		} catch (NotSupportedExtensionException e) {
121 121
			throw new IOException("Formato no valido");
122 122
		} catch (RasterDriverException e) {
......
124 124
		}
125 125
		if(dataset == null)
126 126
			return;
127
		ds = new DataSource(dataset);
127
		bf = new BufferFactory(dataset);
128 128
		createRender();
129 129
	}
130 130

  
131 131
	private void createRender() {
132
		render = new Rendering(ds);
132
		render = new Rendering(bf);
133 133
		/*raster = new Rendering(rasterFile, null, rasterFile.getExtent());
134 134
		raster.setTransparency(false);
135 135
		grid.addRenderizer(raster);*/
......
143 143
	public void addFile(String fileName)throws IOException{
144 144
		try{
145 145
			if(render != null)
146
				ds.addFile(RasterDataset.openFile(getProjection(), fileName));
146
				bf.addFile(RasterDataset.open(getProjection(), fileName));
147 147
		} catch (NotSupportedExtensionException e) {
148 148
			throw new IOException("Formato no valido");
149 149
		} catch (RasterDriverException e) {
......
157 157
	 */
158 158
	public void delFile(String fileName){
159 159
		if(render != null)
160
			ds.removeFile(fileName);
160
			bf.removeFile(fileName);
161 161
	}
162 162

  
163 163
	/*
......
236 236
	 * @see com.iver.cit.gvsig.fmap.drivers.RasterDriver#getRasterDataType()
237 237
	 */
238 238
	public int getRasterDataType() {
239
		return ds.getDataType();
239
		return bf.getDataType();
240 240
	}
241 241

  
242 242
	/* (non-Javadoc)
......
433 433
	 * Obtiene el grid asociado 
434 434
	 * @return grid
435 435
	 */
436
	public DataSource getGrid(){
437
		return ds;
436
	public BufferFactory getGrid(){
437
		return bf;
438 438
	}
439 439
	
440 440
	/**
......
455 455
	 * Get datasource object
456 456
	 * @return DataSource
457 457
	 */
458
	public DataSource getDatasource(){
459
		return this.ds;
458
	public BufferFactory getDatasource(){
459
		return this.bf;
460 460
	}
461 461
	
462 462
	/*

Also available in: Unified diff