Revision 14
trunk/libraries/libCq CMS for java.old/src/org/cresques/io/ShpFile.java | ||
---|---|---|
77 | 77 |
} |
78 | 78 |
return 0; |
79 | 79 |
} |
80 |
|
|
80 | 81 |
public GeoFile load(InputStream is) { |
81 | 82 |
// create a new header. |
82 | 83 |
ShpFileHeader myHeader = new ShpFileHeader(); |
trunk/libraries/libCq CMS for java.old/src/org/cresques/io/DxfFile.java | ||
---|---|---|
238 | 238 |
} |
239 | 239 |
|
240 | 240 |
public void save(String fName) throws IOException { |
241 |
long t2, t1; |
|
242 |
t1 = getTime(); |
|
241 | 243 |
fName = DataSource.normalize(fName); |
242 | 244 |
FileWriter fw = new FileWriter(fName); |
243 | 245 |
// COMMENTAIRES DU TRADUCTEUR |
... | ... | |
250 | 252 |
fw.write(DxfGroup.toString(0, "EOF")); |
251 | 253 |
fw.flush(); |
252 | 254 |
fw.close(); |
255 |
t2 = getTime(); |
|
256 |
System.out.println("DxfFile.save(): Tiempo salvando: " + (t2-t1)/1000 + " seg."); |
|
253 | 257 |
} |
254 | 258 |
|
255 | 259 |
public void writeHeader(FileWriter fw) throws IOException { |
... | ... | |
331 | 335 |
|
332 | 336 |
//layer = new DxfLayer(layerName, 0, 131, "CONTINUOUS"); |
333 | 337 |
//fw.write(layer.toString()); |
334 |
fw.write(((DxfEntityMaker) entityMaker).getLayers().toDxfFileString());
|
|
338 |
fw.write(((DxfEntityMaker) entityMaker).getLayers().toDxfString()); |
|
335 | 339 |
|
336 | 340 |
fw.write(DxfGroup.toString(0, "ENDTAB")); |
337 | 341 |
} |
... | ... | |
340 | 344 |
// ECRITURE DES FEATURES |
341 | 345 |
fw.write(DxfGroup.toString(0, "SECTION")); |
342 | 346 |
fw.write(DxfGroup.toString(2, "ENTITIES")); |
343 |
fw.write(((DxfEntityMaker) entityMaker).getEntities().toDxfFileString());
|
|
347 |
fw.write(((DxfEntityMaker) entityMaker).getEntities().toDxfString()); |
|
344 | 348 |
fw.write(DxfGroup.toString(0, "ENDSEC")); |
345 | 349 |
fw.write(DxfGroup.toString(0, "ENDBLK")); |
346 | 350 |
} |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfPolyline.java | ||
---|---|---|
94 | 94 |
} |
95 | 95 |
//gp.closePath(); |
96 | 96 |
} |
97 |
|
|
98 |
/* (non-Javadoc) |
|
99 |
* @see org.cresques.px.dxf.DxfEntity#toDxfFileString() |
|
97 |
|
|
98 |
/** |
|
99 |
* Convierte a DXF. |
|
100 |
* |
|
101 |
* @return Entity como String Dxf |
|
100 | 102 |
*/ |
101 |
public String toDxfFileString() {
|
|
103 |
public String toDxfString() { |
|
102 | 104 |
StringBuffer sb = null; |
103 | 105 |
sb = new StringBuffer( DxfGroup.toString(0, "POLYLINE") ); |
104 | 106 |
sb.append( DxfGroup.toString(8, layer.getName()) ); |
107 |
sb.append( DxfGroup.toString(62, dxfColor) ); |
|
108 |
sb.append( DxfGroup.toString(70, flags) ); |
|
105 | 109 |
sb.append( DxfGroup.toString(66, 1) ); |
106 |
|
|
107 | 110 |
Point2D pt = null; |
108 | 111 |
Iterator iter = pts.iterator(); |
109 | 112 |
while (iter.hasNext()) { |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfEntity.java | ||
---|---|---|
31 | 31 |
|
32 | 32 |
abstract public void reProject(ReProjection rp); |
33 | 33 |
|
34 |
abstract public String toDxfFileString();
|
|
34 |
abstract public String toDxfString(); |
|
35 | 35 |
} |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfEntityMaker.java | ||
---|---|---|
79 | 79 |
x = ((Float) g.getData()).doubleValue(); |
80 | 80 |
else if (g.getCode() == 20) { |
81 | 81 |
y = ((Float) g.getData()).doubleValue(); |
82 |
if (y <= 1.0) throw new Exception("Y == "+y); |
|
82 |
//if (y <= 1.0) throw new Exception("Y == "+y);
|
|
83 | 83 |
entity.add( proj.createPoint( x, y ) ); |
84 | 84 |
x = 0.0; y = 0.0; |
85 | 85 |
} |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfLayer.java | ||
---|---|---|
35 | 35 |
this.lType = lType; |
36 | 36 |
} |
37 | 37 |
public Color getColor() { return AcadColor.getColor(colorNumber); } |
38 |
public String toDxfFileString() {
|
|
39 |
StringBuffer sb = new StringBuffer(super.toDxfFileString());
|
|
38 |
public String toDxfString() { |
|
39 |
StringBuffer sb = new StringBuffer(super.toDxfString()); |
|
40 | 40 |
sb.append(DxfGroup.toString(62, colorNumber)); |
41 | 41 |
sb.append(DxfGroup.toString(6, lType)); |
42 | 42 |
return sb.toString(); |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfLwPolyline.java | ||
---|---|---|
3 | 3 |
*/ |
4 | 4 |
package org.cresques.px.dxf; |
5 | 5 |
|
6 |
import java.awt.geom.Point2D; |
|
7 |
import java.util.Iterator; |
|
8 |
|
|
6 | 9 |
import org.cresques.geo.Projection; |
10 |
import org.cresques.io.DxfGroup; |
|
7 | 11 |
|
8 | 12 |
/** |
9 | 13 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es> |
... | ... | |
16 | 20 |
/* (non-Javadoc) |
17 | 21 |
* @see org.cresques.px.dxf.DxfEntity#toDxfFileString() |
18 | 22 |
*/ |
19 |
public String toDxfFileString() { |
|
20 |
// TODO Auto-generated method stub |
|
21 |
return null; |
|
23 |
public String toDxfString() { |
|
24 |
StringBuffer sb = null; |
|
25 |
sb = new StringBuffer( DxfGroup.toString(0, "LWPOLYLINE") ); |
|
26 |
sb.append( DxfGroup.toString(8, layer.getName()) ); |
|
27 |
sb.append( DxfGroup.toString(62, dxfColor) ); |
|
28 |
sb.append( DxfGroup.toString(70, flags) ); |
|
29 |
|
|
30 |
sb.append( DxfGroup.toString(90, pts.size()) ); |
|
31 |
Point2D pt = null; |
|
32 |
Iterator iter = pts.iterator(); |
|
33 |
while (iter.hasNext()) { |
|
34 |
pt = (Point2D) iter.next(); |
|
35 |
sb.append( DxfGroup.toString(10, pt.getX(), 6) ); |
|
36 |
sb.append( DxfGroup.toString(20, pt.getY(), 6) ); |
|
37 |
} |
|
38 |
return sb.toString(); |
|
22 | 39 |
} |
23 | 40 |
} |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfText.java | ||
---|---|---|
86 | 86 |
/* (non-Javadoc) |
87 | 87 |
* @see org.cresques.px.dxf.DxfEntity#toDxfFileString() |
88 | 88 |
*/ |
89 |
public String toDxfFileString() {
|
|
89 |
public String toDxfString() { |
|
90 | 90 |
// TODO Auto-generated method stub |
91 |
return null;
|
|
91 |
return "";
|
|
92 | 92 |
} |
93 | 93 |
} |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfTableItem.java | ||
---|---|---|
36 | 36 |
public boolean getFlag64(){return ((flags&64)==64);} |
37 | 37 |
public boolean getFlag128(){return ((flags&128)==128);} |
38 | 38 |
|
39 |
public String toDxfFileString() {
|
|
39 |
public String toDxfString() { |
|
40 | 40 |
return DxfGroup.toString(2, name) + DxfGroup.toString(70, flags); |
41 | 41 |
} |
42 | 42 |
|
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfLine.java | ||
---|---|---|
76 | 76 |
/* (non-Javadoc) |
77 | 77 |
* @see org.cresques.px.dxf.DxfEntity#toDxfFileString() |
78 | 78 |
*/ |
79 |
public String toDxfFileString() {
|
|
79 |
public String toDxfString() { |
|
80 | 80 |
// TODO Auto-generated method stub |
81 |
return null;
|
|
81 |
return "";
|
|
82 | 82 |
} |
83 | 83 |
} |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfTable.java | ||
---|---|---|
38 | 38 |
return capa; |
39 | 39 |
} |
40 | 40 |
|
41 |
public String toDxfFileString() {
|
|
41 |
public String toDxfString() { |
|
42 | 42 |
String txt = ""; |
43 | 43 |
for (int i=0; i<items.size(); i++) { |
44 |
txt += ((DxfLayer) items.get(i)).toDxfFileString();
|
|
44 |
txt += ((DxfLayer) items.get(i)).toDxfString(); |
|
45 | 45 |
} |
46 | 46 |
return txt; |
47 | 47 |
} |
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfEntityList.java | ||
---|---|---|
63 | 63 |
} |
64 | 64 |
} |
65 | 65 |
|
66 |
public String toDxfFileString() { |
|
67 |
String txt = ""; |
|
66 |
public String toDxfString() { |
|
67 |
StringBuffer sb = new StringBuffer(""); |
|
68 |
|
|
68 | 69 |
Iterator iter = entities.iterator(); |
69 | 70 |
Extent extent; |
70 | 71 |
while (iter.hasNext()) { |
71 |
txt += ((DxfEntity) iter.next()).toDxfFileString();
|
|
72 |
sb.append(((DxfEntity) iter.next()).toDxfString());
|
|
72 | 73 |
} |
73 |
return txt;
|
|
74 |
return sb.toString();
|
|
74 | 75 |
} |
75 | 76 |
} |
76 | 77 |
|
Also available in: Unified diff