Statistics
| Revision:

svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfHeaderManager.java @ 2312

History | View | Annotate | Download (2.05 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
 * Clase que gestiona las variables definidas en la secci?n HEADER.
31
 * @author jmorell (jose.morell@gmail.com)
32
 * @version 15-dic-2004
33
 */
34
public class DxfHeaderManager implements DxfFile.VarSettings {
35
        
36
        private DxfHeaderVariables dxfHeadVars;
37
        
38
        /**
39
         * Constructor sin par?metros. Inicializa el vector de variables que
40
         * caracterizan un DXF.
41
         */
42
        public DxfHeaderManager() {
43
                dxfHeadVars = new DxfHeaderVariables();
44
        }
45

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

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

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