Revision 10247 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/gml/GMLDriver.java
GMLDriver.java | ||
---|---|---|
74 | 74 |
* |
75 | 75 |
* $Id$ |
76 | 76 |
* $Log$ |
77 |
* Revision 1.9 2007-01-16 08:40:49 jorpiell |
|
77 |
* Revision 1.10 2007-02-09 14:11:25 jorpiell |
|
78 |
* Soporte para WFS 1.1 |
|
79 |
* |
|
80 |
* Revision 1.9 2007/01/16 08:40:49 jorpiell |
|
78 | 81 |
* Eliminado un improt para hacer que compile |
79 | 82 |
* |
80 | 83 |
* Revision 1.8 2007/01/16 08:34:37 csanchez |
... | ... | |
115 | 118 |
public class GMLDriver extends ConcreteMemoryDriver implements VectorialFileDriver{ |
116 | 119 |
private static Logger logger = Logger.getLogger(GMLDriver.class.getName()); |
117 | 120 |
private File m_Fich; |
118 |
private VectorialUniqueValueLegend defaultLegend; |
|
119 | 121 |
private IGeometriesFactory factory = new FMAPGeometryFactory(); |
120 | 122 |
private Hashtable hashRelate = new Hashtable(); |
121 | 123 |
private ArrayList features = new ArrayList(); |
... | ... | |
152 | 154 |
} catch (GMLException e1) { |
153 | 155 |
e1.printStackTrace(); |
154 | 156 |
throw new IOException(e1.toString()); |
155 |
} |
|
157 |
}
|
|
156 | 158 |
|
157 | 159 |
|
158 |
defaultLegend = LegendFactory.createVectorialUniqueValueLegend(getShapeType()); |
|
159 |
defaultLegend.setFieldName("Color"); |
|
160 |
defaultLegend.setLabelField("Text"); |
|
161 | 160 |
FSymbol symbol = new FSymbol(getShapeType()); |
162 | 161 |
symbol.setShapeVisible(false); |
163 | 162 |
symbol.setFontSizeInPixels(false); |
... | ... | |
167 | 166 |
symbol.setFontSize(heightText); |
168 | 167 |
symbol.setStyle(FConstant.SYMBOL_STYLE_DGNSPECIAL); |
169 | 168 |
symbol.setSize(3); |
170 |
symbol.setSizeInPixels(true); |
|
171 |
defaultLegend.setDefaultSymbol(symbol); |
|
169 |
symbol.setSizeInPixels(true); |
|
172 | 170 |
|
173 |
defaultLegend.setLabelHeightField("HeightText"); |
|
174 |
defaultLegend.setLabelRotationField("RotationText"); |
|
175 |
|
|
176 | 171 |
int index = 0; |
177 | 172 |
|
178 | 173 |
IntValue clave; |
... | ... | |
184 | 179 |
while (iterator.hasNext()) { |
185 | 180 |
try{ |
186 | 181 |
feature = (FeatureWithAttributes)iterator.next(); |
187 |
hashRelate.put(feature.getFeature().getID(), new Integer(index)); |
|
188 |
features.add(feature); |
|
189 |
|
|
190 |
if (!setModel){ |
|
191 |
getTableModel().setColumnIdentifiers(feature.getAttributeName()); |
|
192 |
} |
|
193 |
clave = ValueFactory.createValue(index); |
|
194 |
IGeometry geom = feature.getFeature().getGeometry(); |
|
195 |
if (geom != null){ |
|
196 |
FShape shape = (FShape)geom.getInternalShape(); |
|
182 |
if (feature != null){ |
|
183 |
hashRelate.put(feature.getFeature().getID(), new Integer(index)); |
|
184 |
features.add(feature); |
|
197 | 185 |
|
198 |
theSymbol = new FSymbol(getShapeType()); |
|
199 |
theSymbol.setDescription(clave.toString()); |
|
200 |
theSymbol.setStyle(FConstant.SYMBOL_STYLE_DGNSPECIAL); |
|
201 |
theSymbol.setSize(3); |
|
202 |
theSymbol.setSizeInPixels(true); |
|
203 |
|
|
204 |
addShape(shape, feature.getAttributeValue()); |
|
205 |
defaultLegend.addSymbol(clave, theSymbol); |
|
206 |
} |
|
186 |
if (!setModel){ |
|
187 |
getTableModel().setColumnIdentifiers(feature.getAttributeName()); |
|
188 |
} |
|
189 |
clave = ValueFactory.createValue(index); |
|
190 |
IGeometry geom = feature.getFeature().getGeometry(); |
|
191 |
if (geom != null){ |
|
192 |
FShape shape = (FShape)geom.getInternalShape(); |
|
193 |
|
|
194 |
theSymbol = new FSymbol(getShapeType()); |
|
195 |
theSymbol.setDescription(clave.toString()); |
|
196 |
theSymbol.setStyle(FConstant.SYMBOL_STYLE_DGNSPECIAL); |
|
197 |
theSymbol.setSize(3); |
|
198 |
theSymbol.setSizeInPixels(true); |
|
199 |
|
|
200 |
addShape(shape, feature.getAttributeValue()); |
|
201 |
|
|
202 |
} |
|
203 |
} |
|
207 | 204 |
index++; |
208 | 205 |
}catch(GMLException e){ |
209 | 206 |
logger.error(e.getMessage(),e); |
210 | 207 |
} |
211 | 208 |
} |
212 | 209 |
ListBaseException listwarnings; |
213 |
// if(!warnings.isEmpty()){ |
|
214 |
// System.out.println(warnings.getMessage()); |
|
215 |
// } |
|
216 |
//Show Warnings... |
|
217 |
// if(reader.areWarnings()){ |
|
218 |
// JDialog diag = new JDialog(); |
|
219 |
// diag.setTitle(Messages.getText("warning")); |
|
220 |
// diag.setSize(350, 210); |
|
221 |
// BasicWarningsPanel panel = new BasicWarningsPanel("GML:\n\n El parser intentar? abrir el fichero\n\n Los datos pueden ser erroneos"); |
|
222 |
// diag.getContentPane().add(panel); |
|
223 |
// diag.setResizable(false); |
|
224 |
// |
|
225 |
// //panel.printWarnings(warnings); |
|
226 |
// diag.show(); |
|
227 |
// } |
|
228 | 210 |
listwarnings = reader.getWarnings(); |
229 |
}catch (GMLException e) { |
|
230 |
//e.setFilename(m_Fich.getName()); |
|
211 |
}catch (GMLException e) { |
|
231 | 212 |
logger.error(e.getMessage(),e); |
232 | 213 |
} |
233 | 214 |
} |
Also available in: Unified diff