Statistics
| Revision:

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

History | View | Annotate | Download (2.41 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

    
29
import org.cresques.geo.Projected;
30

    
31
import org.cresques.px.PxObj;
32

    
33

    
34
/**
35
 * Clase ancestro para las entidades de dxf
36
 * jmorell: Implementaci?n del handle imprescindible para el formato DXF2000.
37
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
38
 */
39
public abstract class DxfEntity extends PxObj implements Projected {
40
    IProjection proj = null;
41
    DxfLayer layer = null;
42

    
43
    //int dxfColor = 256;
44
    int dxfColor = 0;
45
    int entitiesFollow = 0;
46
    boolean space = false; // false --> model space, true paper space;
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) {
55
        proj = p;
56
    }
57

    
58
    public IProjection getProjection() {
59
        return proj;
60
    }
61

    
62
    abstract public void reProject(ICoordTrans ct);
63

    
64
    public String getLayerName() {
65
        return layer.getName();
66
    }
67

    
68
    public String getColor() {
69
        return "" + dxfColor;
70
    }
71

    
72
    abstract public String toDxfString();
73

    
74
    /**
75
     * @return Returns the handle.
76
     */
77
    public int getHandle() {
78
        return handle;
79
    }
80

    
81
    /**
82
     * @param handle The handle to set.
83
     */
84
    public void setHandle(int handle) {
85
        this.handle = handle;
86
    }
87

    
88
    /**
89
     * M?todo creado para facilitar la implementaci?n de los ATTRIBS en el piloto.
90
     * @return
91
     */
92
    public DxfLayer getLayer() {
93
        return layer;
94
    }
95
}