Statistics
| Revision:

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

History | View | Annotate | Download (2.25 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.cts.ICoordTrans;
27
import org.cresques.cts.IProjection;
28
import org.cresques.geo.Projected;
29

    
30
import org.cresques.px.PxObj;
31

    
32
/**
33
 * Clase ancestro para las entidades de dxf
34
 * jmorell: Implementaci?n del handle imprescindible para el formato DXF2000.
35
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
36
 */
37

    
38
public abstract class DxfEntity extends PxObj implements Projected  {
39
        IProjection proj = null;
40
        DxfLayer layer = null;
41
        //int dxfColor = 256;
42
        int dxfColor = 0;
43
        
44
        int entitiesFollow = 0;
45
        boolean space = false; // false --> model space, true paper space;
46
        
47
        private int handle;
48

    
49
        public DxfEntity(IProjection proj, DxfLayer layer) {
50
                setProjection(proj);
51
                this.layer = layer;
52
        }
53

    
54
        public void setProjection(IProjection p) { proj = p; }
55
        public IProjection getProjection() { return proj; }
56

    
57
        abstract public void reProject(ICoordTrans ct);
58
        
59
        public String getLayerName()
60
        {
61
                return layer.getName();
62
        }
63
        public String getColor()
64
        {
65
                return "" + dxfColor;
66
        }
67

    
68
        abstract public String toDxfString();
69
        /**
70
         * @return Returns the handle.
71
         */
72
        public int getHandle() {
73
                return handle;
74
        }
75
        /**
76
         * @param handle The handle to set.
77
         */
78
        public void setHandle(int handle) {
79
                this.handle = handle;
80
        }
81
        /**
82
         * M?todo creado para facilitar la implementaci?n de los ATTRIBS en el piloto.
83
         * @return
84
         */
85
        public DxfLayer getLayer() {
86
                return layer;
87
        }
88
}