Revision 3481 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLayers.java
FLayers.java | ||
---|---|---|
51 | 51 |
import java.util.Iterator; |
52 | 52 |
import java.util.List; |
53 | 53 |
|
54 |
import org.apache.log4j.Logger; |
|
54 | 55 |
import org.cresques.cts.ICoordTrans; |
55 | 56 |
import org.cresques.cts.IProjection; |
56 | 57 |
import org.cresques.cts.ProjectionPool; |
... | ... | |
85 | 86 |
private ArrayList layerListeners = new ArrayList(); |
86 | 87 |
private List layers = Collections.synchronizedList(new ArrayList()); |
87 | 88 |
private FMap fmap; |
88 |
|
|
89 |
private static Logger logger = Logger.getLogger(FLayers.class.getName()); |
|
89 | 90 |
/** |
90 | 91 |
* Crea un nuevo FLayers. |
91 | 92 |
* |
... | ... | |
526 | 527 |
* |
527 | 528 |
* @see com.iver.cit.gvsig.fmap.layers.FLyrDefault#setXMLEntity(com.iver.utiles.XMLEntity) |
528 | 529 |
*/ |
529 |
public void setXMLEntity03(XMLEntity xml) throws XMLException {
|
|
530 |
public void setXMLEntity03(XMLEntity xml) throws XMLException{ |
|
530 | 531 |
super.setXMLEntity03(xml); |
531 |
|
|
532 | 532 |
int numLayers = xml.getIntProperty("numLayers"); |
533 | 533 |
|
534 | 534 |
String[] s = xml.getStringArrayProperty("LayerNames"); |
... | ... | |
638 | 638 |
* |
639 | 639 |
* @see com.iver.cit.gvsig.fmap.layers.FLyrDefault#setXMLEntity(com.iver.utiles.XMLEntity) |
640 | 640 |
*/ |
641 |
public void setXMLEntity(XMLEntity xml) throws XMLException {
|
|
641 |
public void setXMLEntity(XMLEntity xml) throws XMLException{ |
|
642 | 642 |
super.setXMLEntity(xml); |
643 |
|
|
643 |
//LoadLayerException loadLayerException=new LoadLayerException(); |
|
644 | 644 |
int numLayers = xml.getIntProperty("numLayers"); |
645 | 645 |
|
646 | 646 |
String[] s = xml.getStringArrayProperty("LayerNames"); |
... | ... | |
799 | 799 |
layer.load(); |
800 | 800 |
}catch (DriverIOException e) { |
801 | 801 |
throw new XMLException(e); |
802 |
}catch (Exception e) { |
|
803 |
layer.setActive(false); |
|
804 |
layer.setVisible(false); |
|
805 |
this.addLayer(layer); |
|
806 |
throw new XMLException(e); |
|
807 | 802 |
} |
808 | 803 |
|
809 | 804 |
} |
810 |
|
|
805 |
|
|
811 | 806 |
this.addLayer(layer); |
812 |
// Comprobar que la proyecci?n es la misma que la de FMap |
|
807 |
logger.debug("capa :"+ layer.getName() +"cargada"); |
|
808 |
// Comprobar que la proyecci?n es la misma que la de FMap |
|
813 | 809 |
// Si no lo es, es una capa que est? reproyectada al vuelo |
814 | 810 |
IProjection proj = layer.getProjection(); |
815 | 811 |
if ((proj != null)) |
... | ... | |
836 | 832 |
} |
837 | 833 |
} |
838 | 834 |
}catch (Exception e) { |
839 |
if (layer!=null){ |
|
835 |
fmap.addLayerError(xml.getChild(i).getStringProperty("name")); |
|
836 |
//loadLayerException.addException(e); |
|
837 |
/*if (layer!=null){ |
|
840 | 838 |
layer.setActive(false); |
841 | 839 |
layer.setVisible(false); |
842 | 840 |
this.addLayer(layer); |
843 |
} |
|
841 |
}*/
|
|
844 | 842 |
//throw new XMLException(e); |
845 | 843 |
System.err.println("No se ha podido cargar la capa : "+xml.getChild(i).getStringProperty("name")); |
846 |
|
|
844 |
logger.debug("No se ha podido cargar la capa : "+xml.getChild(i).getStringProperty("name")); |
|
847 | 845 |
} |
846 |
|
|
848 | 847 |
} |
849 | 848 |
/* } catch (DriverException e) { |
850 | 849 |
throw new XMLException(e); |
851 | 850 |
} */ |
852 |
|
|
851 |
/*if (loadLayerException.getExceptions().size()>0){ |
|
852 |
throw loadLayerException; |
|
853 |
}*/ |
|
853 | 854 |
} |
854 | 855 |
|
855 | 856 |
/** |
Also available in: Unified diff