Revision 36746 trunk/extensions/extRasterTools-SE/src/org/gvsig/fmap/raster/layers/FLyrRasterSE.java

View differences:

FLyrRasterSE.java
167 167
	private boolean               loadingFromProject    = false;
168 168
	
169 169
	protected String              readingData           = null;
170
	
171
	//It is set to true if the method init has been called at least once
172
	protected boolean             layerInitialize       = false;
170 173

  
171 174
	private static PathGenerator pathGenerator=PathGenerator.getInstance();
172 175
	
......
341 344
		} catch (Exception e) {
342 345
			throw new LoadLayerException("No existe la capa.", e);
343 346
		}
344
		if (dataset != null)
345
			this.init();
347
		//if (dataset != null)
348
			//this.init();
346 349
	}
347 350

  
348 351
	/**
......
352 355
	 * implementen IRasterDatasource.
353 356
	 */
354 357
	public void init() throws LoadLayerException {
358
		layerInitialize = true;
359
		
355 360
		if (dataset == null)
356 361
			throw new LoadLayerException("Formato no valido", new IOException());
357 362
				
......
561 566
		this.image = image;
562 567
		RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString());
563 568
		
569
		if(!layerInitialize)
570
			try {
571
				init();
572
			} catch (LoadLayerException e1) {
573
				throw new ReadDriverException("Error initializing the layer", e1);
574
			}
575
		
564 576
		task.setEvent(null);
565 577

  
566 578
		try {
......
2074 2086
	 */
2075 2087
	public FLayer cloneLayer() throws Exception {
2076 2088
		FLyrRasterSE newLayer = FLyrRasterSE.createLayer(this.getName(), params, this.getProjection());
2089
		newLayer.init();
2077 2090
		for (int i = 0; i < dataset.getDatasetCount(); i++) {
2078 2091
			String name = dataset.getDataset(i)[0].getOpenParameters();
2079 2092
			if (!(dataset instanceof CompositeDataset) && !name.equals(this.getName()) && !isActionEnabled(IRasterLayerActions.REMOTE_ACTIONS))

Also available in: Unified diff