Revision 10627 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrDefault.java

View differences:

FLyrDefault.java
53 53
import org.apache.log4j.Logger;
54 54
import org.cresques.cts.ICoordTrans;
55 55
import org.cresques.cts.IProjection;
56
import org.gvsig.exceptions.BaseException;
56 57

  
57
import com.iver.cit.gvsig.fmap.DriverException;
58
import com.hardcode.gdbms.engine.data.driver.DriverException;
59
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException;
60
import com.iver.cit.gvsig.exceptions.layers.ReloadLayerException;
61
import com.iver.cit.gvsig.exceptions.layers.StartEditionLayerException;
58 62
import com.iver.cit.gvsig.fmap.MapContext;
59 63
import com.iver.cit.gvsig.fmap.crs.CRSFactory;
60 64
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
61
import com.iver.cit.gvsig.fmap.edition.EditionException;
62 65
import com.iver.cit.gvsig.fmap.operations.strategies.Strategy;
63 66
import com.iver.utiles.IPersistance;
64 67
import com.iver.utiles.XMLEntity;
......
162 165
	/*
163 166
	 * @see com.iver.cit.gvsig.fmap.layers.FLayer#load()
164 167
	 */
165
	public void load() throws DriverIOException {
168
	public void load() throws LoadLayerException {
166 169
	}
167 170

  
168 171
	/**
......
293 296

  
294 297
		// persist Properties hashTable
295 298

  
296
		
299

  
297 300
		Set keyset = properties.keySet();
298
		
299
		
300 301

  
302

  
303

  
301 304
		Iterator keyitr = keyset.iterator();
302 305
		XMLEntity xmlProperties = new XMLEntity();
303 306
		xmlProperties.putProperty("childName","properties");
......
319 322
	        	  }
320 323
	          }
321 324
	          xmlPropObj.putProperty("layerPropertyName", propName);
322
	          xmlProperties.addChild(xmlPropObj);	          
325
	          xmlProperties.addChild(xmlPropObj);
323 326
	      } else if (obj instanceof String) {
324 327
	          XMLEntity xmlPropObj = new XMLEntity();
325 328
        	  xmlPropObj.putProperty("className", String.class.getName());
326 329
        	  xmlPropObj.putProperty("value",(String)obj);
327 330
	          xmlPropObj.putProperty("layerPropertyName", propName);
328
	          xmlProperties.addChild(xmlPropObj);	          
331
	          xmlProperties.addChild(xmlPropObj);
329 332

  
330 333
	      }
331 334
	    }
332 335
	    if (xmlProperties.getChildrenCount() > 0) {
333 336
	    	xml.addChild(xmlProperties);
334 337
	    }
335
	    
338

  
336 339
		return xml;
337 340
	}
338 341

  
......
381 384
			status.inTOC = xml.getBooleanProperty("isInTOC");
382 385

  
383 386
        // recreate Properties hashTable
384
		
387

  
385 388
		int xmlPropertiesPos = xml.firstIndexOfChild("childName","properties");
386 389
		XMLEntity xmlProperties =null;
387 390
		if (xmlPropertiesPos > -1)
388 391
			xmlProperties = xml.getChild(xmlPropertiesPos);
389
		
392

  
390 393
		if (xmlProperties != null) {
391
			
394

  
392 395
			int numProps = xmlProperties.getChildrenCount();
393 396
			Object obj;
394 397
			String className;
......
405 408
        	    		obj = classProp.newInstance();
406 409
        	    		objPersist = (IPersistance)obj;
407 410
        	    		objPersist.setXMLEntity(xmlProp);
408
        	    		        	    		
411

  
409 412
        	    	}
410 413
        	    	String propName = xmlProp.getStringProperty("layerPropertyName");
411 414
        	    	properties.put(propName, obj);
......
415 418
        		}
416 419
            }
417 420
       		// remove Properties children to avoid breaking layers' XML reading logic
418
        	xml.removeChild(xmlPropertiesPos);	
421
        	xml.removeChild(xmlPropertiesPos);
419 422
		}
420
		
423

  
421 424
	}
422 425

  
423 426
	/**
......
589 592
	 * hacer algo antes de ser a?adida. Por ejemplo, el raster necesita volver a
590 593
	 * abrir el fichero que ha podido ser cerrado con anterioridad. Si no se
591 594
	 * redefine este m?todo no se har? nada ya que este es vacio.
595
	 * @throws LoadLayerException
592 596
	 */
593
	public void wakeUp() {
597
	public void wakeUp() throws LoadLayerException {
594 598
	}
595 599

  
596 600
	public double getMinScale() {
......
637 641
		privateStrategy = s;
638 642
	}
639 643

  
640
	public void setEditing(boolean b) throws EditionException {
644
	public void setEditing(boolean b) throws StartEditionLayerException {
641 645
//		isediting = b;
642 646
		status.editing = b;
643 647
		setDirty(true);
......
708 712
		status.available = available;
709 713
	}
710 714

  
711
	public void reload() throws DriverIOException {
715
	public void reload() throws ReloadLayerException {
712 716
		this.setAvailable(true);
713 717
	}
714 718

  
......
739 743
		return status.getNumErrors();
740 744
	}
741 745

  
742
	public DriverException getError(int i){
746
	public BaseException getError(int i){
743 747
		return status.getError(i);
744 748
	}
745 749

  
......
747 751
		return status.getErrors();
748 752
	}
749 753

  
750
	public void addError(DriverException error){
751
		status.addLayerError(error);
754
	public void addError(BaseException exception){
755
		status.addLayerError(exception);
752 756
	}
753 757

  
754 758
	public boolean visibleRequired() {
......
762 766
	public boolean isWritable() {
763 767
		return status.writable;
764 768
	}
765
	
769

  
766 770
	/* (non-Javadoc)
767 771
	 * @see com.iver.cit.gvsig.fmap.layers.FLayer#cloneLayer()
768 772
	 */

Also available in: Unified diff