Statistics
| Revision:

svn-gvsig-desktop / branches / v02_desarrollo / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfLayer.java @ 1607

History | View | Annotate | Download (1.46 KB)

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

    
7
import java.awt.Color;
8

    
9
import org.cresques.io.DxfGroup;
10

    
11
/**
12
 * Capas de dxf
13
 * jmorell: Actualizaci?n a la versi?n DXF2000.
14
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
15
 */
16

    
17
public class DxfLayer extends DxfTableItem {
18
        int colorNumber = 9;
19
        String lType = "CONTINUOUS";
20
        boolean frozen=false;
21
        boolean isOff=false;
22
        
23
        public DxfLayer(String name) {
24
                super(name, 0);
25
                System.out.println("Dxf: Capa '"+name+"'.");
26
                colorNumber = 255;        
27
                lType = "CONTINUOUS";
28
        }
29
        public DxfLayer(String name, int clr) {
30
                super(name, 0);
31
                colorNumber = clr;        
32
                lType = "CONTINUOUS";
33
                System.out.println("DxfLayer name="+name+", color="+colorNumber);
34
        }
35
        public DxfLayer(String name, int clr, String lType) {
36
                super(name, 0);
37
                colorNumber = clr;        
38
                this.lType = lType;
39
        }
40
        public Color getColor() { return AcadColor.getColor(colorNumber); }
41
        public String toDxfString() {
42
                  /*5
43
                  10
44
                  330
45
                  2
46
                  100
47
                  AcDbSymbolTableRecord
48
                  100
49
                  AcDbLayerTableRecord
50
                    2
51
                  0
52
                   70
53
                       0
54
                   62
55
                       7
56
                    6
57
                  Continuous
58
                  370
59
                      -3
60
                  390
61
                  F*/
62
                StringBuffer sb = new StringBuffer(LAYER.toString()+super.toDxfString());
63
                sb.append(DxfGroup.toString(5, 10));
64
                sb.append(DxfGroup.toString(100, "AcDbSymbolTableRecord"));
65
                sb.append(DxfGroup.toString(100, "AcDbLayerTableRecord"));
66
                sb.append(DxfGroup.toString(62, colorNumber));
67
                sb.append(DxfGroup.toString(6, lType));
68
                return sb.toString();
69
        }
70
}