Revision 3481
trunk/extensions/extJDBC/src/com/iver/cit/gvsig/fmap/drivers/jdbc/postgis/PostGisDriver.java | ||
---|---|---|
636 | 636 |
if (workingArea != null) |
637 | 637 |
r = r.createIntersection(workingArea); |
638 | 638 |
//if (getLyrDef()==null){ |
639 |
load(); |
|
639 |
//load();
|
|
640 | 640 |
//throw new DriverException("Fallo de la conexi?n"); |
641 | 641 |
//} |
642 | 642 |
String strAux = getGeometryField(getLyrDef().getFieldGeometry()); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectView.java | ||
---|---|---|
41 | 41 |
package com.iver.cit.gvsig.project; |
42 | 42 |
|
43 | 43 |
import java.awt.Color; |
44 |
import java.awt.Component; |
|
44 | 45 |
import java.text.DateFormat; |
45 | 46 |
import java.util.Date; |
46 | 47 |
|
48 |
import javax.swing.JOptionPane; |
|
49 |
|
|
47 | 50 |
import org.cresques.cts.IProjection; |
48 | 51 |
|
52 |
import com.iver.andami.PluginServices; |
|
49 | 53 |
import com.iver.cit.gvsig.fmap.DriverException; |
50 | 54 |
import com.iver.cit.gvsig.fmap.FMap; |
51 | 55 |
import com.iver.cit.gvsig.fmap.ViewPort; |
... | ... | |
179 | 183 |
m_typeLink = xml.getIntProperty("m_typeLink"); |
180 | 184 |
m_extLink = xml.getStringProperty("m_extLink"); |
181 | 185 |
setMapContext(FMap.createFromXML03(xml.getChild(0))); |
182 |
|
|
186 |
|
|
183 | 187 |
if (xml.getBooleanProperty("mapOverView")) { |
184 | 188 |
setMapOverViewContext(FMap.createFromXML03(xml.getChild(1))); |
185 | 189 |
} |
190 |
|
|
186 | 191 |
} |
187 | 192 |
|
188 | 193 |
/** |
... | ... | |
200 | 205 |
public void setXMLEntity(XMLEntity xml, Project p) |
201 | 206 |
throws XMLException, DriverException, DriverIOException, OpenException { |
202 | 207 |
try{ |
203 |
numViews = xml.getIntProperty("numViews"); |
|
204 |
m_selectedField = xml.getStringProperty("m_selectedField"); |
|
205 |
m_typeLink = xml.getIntProperty("m_typeLink"); |
|
206 |
m_extLink = xml.getStringProperty("m_extLink"); |
|
207 |
setMapContext(FMap.createFromXML(xml.getChild(0))); |
|
208 |
|
|
209 |
if (xml.getBooleanProperty("mapOverView")) { |
|
210 |
setMapOverViewContext(FMap.createFromXML(xml.getChild(1))); |
|
211 |
} |
|
208 |
numViews = xml.getIntProperty("numViews"); |
|
209 |
m_selectedField = xml.getStringProperty("m_selectedField"); |
|
210 |
m_typeLink = xml.getIntProperty("m_typeLink"); |
|
211 |
m_extLink = xml.getStringProperty("m_extLink"); |
|
212 |
setMapContext(FMap.createFromXML(xml.getChild(0))); |
|
213 |
|
|
214 |
if (xml.getBooleanProperty("mapOverView")) { |
|
215 |
setMapOverViewContext(FMap.createFromXML(xml.getChild(1))); |
|
216 |
} |
|
217 |
if (mapContext.getLayersError().size()>0){ |
|
218 |
String layersError=""; |
|
219 |
for (int i=0;i<mapContext.getLayersError().size();i++){ |
|
220 |
layersError=layersError+"\n"+(String)mapContext.getLayersError().get(i); |
|
221 |
} |
|
222 |
JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), |
|
223 |
PluginServices.getText(this,"fallo_capas")+" : \n"+ |
|
224 |
layersError); |
|
225 |
} |
|
212 | 226 |
}catch (Exception e) { |
213 | 227 |
throw new OpenException(e,this.getClass().getName()); |
214 | 228 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/LayerFactory.java | ||
---|---|---|
186 | 186 |
throw new DriverException(e); |
187 | 187 |
}*/ |
188 | 188 |
}catch (Exception e) { |
189 |
JOptionPane.showMessageDialog(null,"Se ha producido un error cargando la capa '" |
|
189 |
/* JOptionPane.showMessageDialog(null,"Se ha producido un error cargando la capa '"
|
|
190 | 190 |
+layerName+"'\n El recurso asociado a la capa es : " |
191 | 191 |
+f.getAbsolutePath()+"\n Esta capa ser? eliminada del proyecto."); |
192 |
*/ |
|
192 | 193 |
//capa.setBroken(true); |
193 | 194 |
//return capa; |
194 | 195 |
throw new DriverException(e); |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/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 |
/** |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/FMap.java | ||
---|---|---|
110 | 110 |
private ArrayList legendListeners = new ArrayList(); |
111 | 111 |
private EventBuffer eventBuffer = new EventBuffer(); |
112 | 112 |
private LayerEventListener layerEventListener=null; |
113 |
private ArrayList layersError=new ArrayList(); |
|
113 | 114 |
// public static ResourceBundle myResourceBundle = ResourceBundle.getBundle("FMap"); |
114 | 115 |
|
115 | 116 |
/** |
... | ... | |
575 | 576 |
* |
576 | 577 |
* @throws XMLException |
577 | 578 |
*/ |
578 |
public static FMap createFromXML(XMLEntity xml) throws XMLException {
|
|
579 |
public static FMap createFromXML(XMLEntity xml) throws XMLException{ |
|
579 | 580 |
ViewPort vp = ViewPort.createFromXML(xml.getChild(0)); |
580 | 581 |
FMap fmap = new FMap(vp); |
581 | 582 |
fmap.layers.setXMLEntity(xml.getChild(1)); |
... | ... | |
744 | 745 |
} |
745 | 746 |
return isEqual; |
746 | 747 |
} |
748 |
|
|
749 |
public void addLayerError(String stringProperty) { |
|
750 |
layersError.add(stringProperty); |
|
751 |
} |
|
752 |
public ArrayList getLayersError(){ |
|
753 |
return layersError; |
|
754 |
} |
|
747 | 755 |
} |
Also available in: Unified diff