Statistics
| Revision:

root / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfSpline.java @ 1733

History | View | Annotate | Download (1.01 KB)

1
/*
2
 * Created on 04-may-2004
3
 */
4
package org.cresques.px.dxf;
5

    
6
import java.awt.geom.Point2D;
7
import java.util.Iterator;
8

    
9
import org.cresques.geo.Projection;
10
import org.cresques.io.DxfGroup;
11

    
12
/**
13
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
14
 */
15
public class DxfSpline extends DxfPolyline {
16
        public DxfSpline(Projection proj, DxfLayer layer) {
17
                super(proj, layer);
18
        }
19

    
20
        /* (non-Javadoc)
21
         * @see org.cresques.px.dxf.DxfEntity#toDxfFileString()
22
         */
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(100, "AcDbPolyline") );
29
                sb.append( DxfGroup.toString(90, pts.size()) );
30
                Point2D pt = null;
31
                Iterator iter = pts.iterator();
32
                while (iter.hasNext()) {
33
                        pt = (Point2D) iter.next();
34
                        sb.append( DxfGroup.toString(10, pt.getX(), 6) );
35
                        sb.append( DxfGroup.toString(20, pt.getY(), 6) );
36
                }
37
                return sb.toString();
38
        }
39
}