Statistics
| Revision:

root / trunk / libraries / libCq_CMS_praster / src / org / cresques / px / dxf / DxfHeaderManager.java @ 8026

History | View | Annotate | Download (2.47 KB)

1
/*
2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 *
4
 * Copyright (C) 2004-5.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 * cresques@gmail.com
23
 */
24
package org.cresques.px.dxf;
25

    
26
import org.cresques.io.DxfFile;
27
import org.cresques.io.DxfGroupVector;
28

    
29

    
30
/**
31
 * La clase DxfHeaderManager gestiona las variables definidas en la secci?n HEADER de
32
 * un fichero DXF.
33
 * @author jmorell (jose.morell@gmail.com)
34
 * @version 15-dic-2004
35
 */
36
public class DxfHeaderManager implements DxfFile.VarSettings {
37
    private DxfHeaderVariables dxfHeadVars;
38

    
39
    /**
40
     * Constructor sin par?metros. Inicializa el vector de variables que
41
     * caracterizan un DXF.
42
     */
43
    public DxfHeaderManager() {
44
        dxfHeadVars = new DxfHeaderVariables();
45
    }
46

    
47
    /* (non-Javadoc)
48
     * @see org.cresques.io.DxfFile.VarSettings#getDxfHeaderVars()
49
     */
50
    public DxfHeaderVariables getDxfHeaderVars() {
51
        return dxfHeadVars;
52
    }
53

    
54
    /* (non-Javadoc)
55
     * @see org.cresques.io.DxfFile.VarSettings#setAcadVersion(org.cresques.io.DxfGroupVector)
56
     */
57
    public void setAcadVersion(DxfGroupVector v) throws Exception {
58
        if (v.hasCode(1)) {
59
            String codedVersion = new String(v.getDataAsString(1));
60
            dxfHeadVars.setAcadVersion(dxfHeadVars.decodeAcadVersion(codedVersion));
61
        }
62
    }
63

    
64
    /* (non-Javadoc)
65
     * @see org.cresques.io.DxfFile.VarSettings#getAcadVersion()
66
     */
67
    public String getAcadVersion() {
68
        return dxfHeadVars.getAcadVersion();
69
    }
70

    
71
    public boolean isWritedDxf3D() {
72
        return dxfHeadVars.isWritedDxf3D();
73
    }
74

    
75
    public void loadMinZFromHeader(double d) {
76
        dxfHeadVars.loadMinZFromHeader(d);
77
    }
78

    
79
    public void loadMaxZFromHeader(double d) {
80
        dxfHeadVars.loadMaxZFromHeader(d);
81
    }
82
}