Revision 881 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dxf/DXFMemoryDriver.java
DXFMemoryDriver.java | ||
---|---|---|
88 | 88 |
//System.out.println("initialize(): acadVersion = " + acadVersion); |
89 | 89 |
|
90 | 90 |
int nAtt = featureMaker.getAttributes().size(); |
91 |
//Object [] auxRow = new Object[6+nAtt]; |
|
92 | 91 |
Value[] auxRow = new Value[6+nAtt]; |
93 | 92 |
ArrayList arrayFields = new ArrayList(); |
94 | 93 |
arrayFields.add("ID"); |
... | ... | |
104 | 103 |
} |
105 | 104 |
|
106 | 105 |
// Campos de las MemoryLayer: |
107 |
//Object [] auxRowTxt = new Object[9+nAtt]; |
|
108 | 106 |
Value[] auxRowTxt = new Value[9+nAtt]; |
109 | 107 |
ArrayList arrayFieldsTxt = new ArrayList(); |
110 | 108 |
arrayFieldsTxt.add("ID"); |
... | ... | |
123 | 121 |
} |
124 | 122 |
|
125 | 123 |
getTableModel().setColumnIdentifiers(arrayFields.toArray()); |
126 |
|
|
127 |
//FShape aux; |
|
128 | 124 |
|
129 | 125 |
for (int i=0;i<features.size();i++) { |
130 | 126 |
|
... | ... | |
134 | 130 |
|
135 | 131 |
Feature fea = (Feature)features.get(i); |
136 | 132 |
if (fea.getGeometry() instanceof Point) { |
137 |
// m_BoundingBox.add((Rectangle2D.Double)fea.getGeometry().getExtent().toRectangle2D()); |
|
138 | 133 |
Point point = (Point)fea.getGeometry(); |
139 | 134 |
Point2D pto = new Point2D.Double(); |
140 | 135 |
pto = (Point2D.Double)point.get(0); |
... | ... | |
149 | 144 |
auxRowTxt[ID_FIELD_TEXT] = ValueFactory.createValue(new String(fea.getProp("text"))); |
150 | 145 |
double auxH = Double.parseDouble(fea.getProp("textHeight")); |
151 | 146 |
auxRowTxt[ID_FIELD_HEIGHTTEXT] = ValueFactory.createValue(auxH); |
152 |
//System.out.println("fea.getProp(textRotation) = " + fea.getProp("textRotation")); |
|
153 | 147 |
double auxR = Double.parseDouble(fea.getProp("textRotation")); |
154 | 148 |
auxRowTxt[ID_FIELD_ROTATIONTEXT] = ValueFactory.createValue(auxR); |
155 | 149 |
double auxE = Double.parseDouble(fea.getProp("elevation")); |
... | ... | |
213 | 207 |
FShape nuevoShp = new FPoint3D(pto.getX(),pto.getY(),0); |
214 | 208 |
addShape(nuevoShp, auxRow); |
215 | 209 |
} else if (fea.getGeometry() instanceof LineString) { |
216 |
// m_BoundingBox.add((Rectangle2D.Double)fea.getGeometry().getExtent().toRectangle2D()); |
|
217 | 210 |
GeneralPathX genPathX = new GeneralPathX(); |
218 | 211 |
Point2D[] pts = new Point2D[fea.getGeometry().pointNr()]; |
219 | 212 |
for (int j=0; j<fea.getGeometry().pointNr(); j++) { |
... | ... | |
244 | 237 |
FShape nuevoShp = new FPolyline2D(genPathX); |
245 | 238 |
addShape(nuevoShp, auxRow); |
246 | 239 |
} else if (fea.getGeometry() instanceof Polygon) { |
247 |
// m_BoundingBox.add((Rectangle2D.Double)fea.getGeometry().getExtent().toRectangle2D()); |
|
248 | 240 |
GeneralPathX genPathX = new GeneralPathX(); |
249 | 241 |
Point2D[] pts = new Point2D[fea.getGeometry().pointNr()]; |
250 | 242 |
for (int j=0; j<fea.getGeometry().pointNr(); j++) { |
... | ... | |
275 | 267 |
FShape nuevoShp = new FPolygon2D(genPathX); |
276 | 268 |
addShape(nuevoShp, auxRow); |
277 | 269 |
} else { |
278 |
System.out.println("Detectado feature raro");
|
|
270 |
System.out.println("Detectado feature desconocido");
|
|
279 | 271 |
} |
280 | 272 |
} |
281 | 273 |
|
282 | 274 |
defaultLegend = LegendFactory.createVectorialUniqueValueLegend(getShapeType()); |
283 | 275 |
defaultLegend.setFieldName("Color"); |
284 | 276 |
|
285 |
defaultLegend.setLabelField("Text"); |
|
277 |
//defaultLegend.setLabelField("Text");
|
|
286 | 278 |
defaultLegend.setDefaultSymbol(new FSymbol(getShapeType())); |
287 | 279 |
defaultLegend.getDefaultSymbol().setShapeVisible(false); |
288 | 280 |
defaultLegend.getDefaultSymbol().setFontSizeInPixels(false); |
... | ... | |
306 | 298 |
{ |
307 | 299 |
theSymbol = new FSymbol(getShapeType()); |
308 | 300 |
theSymbol.setDescription(clave.toString()); |
309 |
//theSymbol.m_Color = AcadColor.getColor(rs.getFieldValueAsNumber(ID_FIELD_COLOR).intValue()); |
|
310 | 301 |
theSymbol.setColor(AcadColor.getColor(clave.getValue())); |
311 | 302 |
defaultLegend.addSymbol(clave, theSymbol); |
312 | 303 |
} |
313 | 304 |
} // for |
314 | 305 |
} catch (DriverException e) { |
315 | 306 |
e.printStackTrace(); |
316 |
throw new IOException("Error al poner la legenda por defecto en el DGN");
|
|
307 |
throw new IOException("Error al poner la legenda por defecto en el DXF");
|
|
317 | 308 |
} |
318 | 309 |
} |
319 | 310 |
|
Also available in: Unified diff