7 |
7 |
import java.util.ArrayList;
|
8 |
8 |
import java.util.Hashtable;
|
9 |
9 |
|
|
10 |
import javax.swing.JDialog;
|
|
11 |
|
10 |
12 |
import org.apache.log4j.Logger;
|
11 |
|
import org.cresques.cts.ICoordTrans;
|
12 |
|
import org.cresques.cts.IProjection;
|
13 |
|
import org.cresques.cts.ProjectionPool;
|
14 |
|
import org.gvsig.remoteClient.gml.GMLException;
|
|
13 |
import org.gvsig.exceptions.ListBaseException;
|
15 |
14 |
import org.gvsig.remoteClient.gml.GMLReader;
|
16 |
15 |
import org.gvsig.remoteClient.gml.IGMLFeaturesIterator;
|
|
16 |
import org.gvsig.remoteClient.gml.exceptions.GMLException;
|
|
17 |
import org.gvsig.remoteClient.gml.exceptions.GMLExceptionList;
|
17 |
18 |
import org.gvsig.remoteClient.gml.factories.IGeometriesFactory;
|
18 |
19 |
|
19 |
20 |
import com.hardcode.gdbms.engine.values.IntValue;
|
... | ... | |
28 |
29 |
import com.iver.cit.gvsig.fmap.drivers.gml.FMAPGeometryFactory.FeatureWithAttributes;
|
29 |
30 |
import com.iver.cit.gvsig.fmap.rendering.LegendFactory;
|
30 |
31 |
import com.iver.cit.gvsig.fmap.rendering.VectorialUniqueValueLegend;
|
|
32 |
import com.iver.cit.gvsig.gmlWarnings.BasicWarningsPanel;
|
31 |
33 |
|
32 |
34 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
33 |
35 |
*
|
... | ... | |
73 |
75 |
*
|
74 |
76 |
* $Id$
|
75 |
77 |
* $Log$
|
76 |
|
* Revision 1.7 2006-12-29 17:12:10 jorpiell
|
|
78 |
* Revision 1.8 2007-01-16 08:34:37 csanchez
|
|
79 |
* Sistema de Warnings y Excepciones adaptado a BasicException
|
|
80 |
*
|
|
81 |
* Revision 1.7 2006/12/29 17:12:10 jorpiell
|
77 |
82 |
* Se tienen en cuenta los simpleTypes y los choices, adem?s de los atributos multiples
|
78 |
83 |
*
|
79 |
84 |
* Revision 1.6 2006/10/02 08:49:50 jorpiell
|
... | ... | |
113 |
118 |
private Hashtable hashRelate = new Hashtable();
|
114 |
119 |
private ArrayList features = new ArrayList();
|
115 |
120 |
private IGMLFeaturesIterator iterator = null;
|
|
121 |
private GMLReader reader;
|
116 |
122 |
|
117 |
123 |
/*
|
118 |
124 |
* (non-Javadoc)
|
... | ... | |
135 |
141 |
* (non-Javadoc)
|
136 |
142 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#initialize()
|
137 |
143 |
*/
|
138 |
|
public void initialize() throws IOException {
|
|
144 |
public void initialize() throws IOException{
|
139 |
145 |
float heightText = 10;
|
140 |
146 |
|
141 |
147 |
try {
|
142 |
|
GMLReader reader = new GMLReader(m_Fich,factory);
|
|
148 |
reader = new GMLReader(m_Fich,factory);
|
143 |
149 |
iterator = reader.getFeaturesIterator();
|
144 |
|
} catch (Exception e1) {
|
|
150 |
} catch (GMLException e1) {
|
145 |
151 |
e1.printStackTrace();
|
146 |
152 |
throw new IOException(e1.toString());
|
147 |
153 |
}
|
... | ... | |
182 |
188 |
if (!setModel){
|
183 |
189 |
getTableModel().setColumnIdentifiers(feature.getAttributeName());
|
184 |
190 |
}
|
185 |
|
|
186 |
191 |
clave = ValueFactory.createValue(index);
|
187 |
192 |
IGeometry geom = feature.getFeature().getGeometry();
|
188 |
193 |
if (geom != null){
|
... | ... | |
200 |
205 |
index++;
|
201 |
206 |
}catch(GMLException e){
|
202 |
207 |
logger.error(e.getMessage(),e);
|
203 |
|
}catch(Exception e){
|
204 |
|
logger.error(e.getMessage(),e);
|
205 |
208 |
}
|
206 |
|
|
207 |
209 |
}
|
208 |
|
} catch (GMLException e) {
|
|
210 |
ListBaseException listwarnings;
|
|
211 |
// if(!warnings.isEmpty()){
|
|
212 |
// System.out.println(warnings.getMessage());
|
|
213 |
// }
|
|
214 |
//Show Warnings...
|
|
215 |
// if(reader.areWarnings()){
|
|
216 |
// JDialog diag = new JDialog();
|
|
217 |
// diag.setTitle(Messages.getText("warning"));
|
|
218 |
// diag.setSize(350, 210);
|
|
219 |
// BasicWarningsPanel panel = new BasicWarningsPanel("GML:\n\n El parser intentar? abrir el fichero\n\n Los datos pueden ser erroneos");
|
|
220 |
// diag.getContentPane().add(panel);
|
|
221 |
// diag.setResizable(false);
|
|
222 |
//
|
|
223 |
// //panel.printWarnings(warnings);
|
|
224 |
// diag.show();
|
|
225 |
// }
|
|
226 |
listwarnings = reader.getWarnings();
|
|
227 |
}catch (GMLException e) {
|
|
228 |
//e.setFilename(m_Fich.getName());
|
209 |
229 |
logger.error(e.getMessage(),e);
|
210 |
|
}
|
211 |
|
|
|
230 |
}
|
212 |
231 |
}
|
213 |
232 |
|
214 |
233 |
|