Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / libraries / libDwg / src / com / iver / cit / jdwglib / dwg / objects / DwgLayer.java @ 10539

History | View | Annotate | Download (5.3 KB)

1
/* jdwglib. Java Library for reading Dwg files.
2
 * 
3
 * Author: Jose Morell Rama (jose.morell@gmail.com).
4
 * Port from the Pythoncad Dwg library by Art Haas.
5
 *
6
 * Copyright (C) 2005 Jose Morell, IVER TI S.A. and Generalitat Valenciana
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
21
 *
22
 * For more information, contact:
23
 *
24
 * Jose Morell (jose.morell@gmail.com)
25
 * 
26
 * or
27
 *
28
 * IVER TI S.A.
29
 *  C/Salamanca, 50
30
 *  46005 Valencia
31
 *  Spain
32
 *  +34 963163400
33
 *  dac@iver.es
34
 */
35
package com.iver.cit.jdwglib.dwg.objects;
36

    
37
import com.iver.cit.jdwglib.dwg.DwgHandleReference;
38
import com.iver.cit.jdwglib.dwg.DwgObject;
39

    
40
/**
41
 * The DwgLayer class represents a DWG Layer
42
 * 
43
 * @author jmorell
44
 */
45
public class DwgLayer extends DwgObject {
46
        public DwgLayer(int index) {
47
                super(index);
48
                // TODO Auto-generated constructor stub
49
        }
50
        private String name;
51
        private boolean flag64;
52
        private int xRefPlus;
53
        private boolean xdep;
54
        private int flags;
55
        private int color;
56
        private DwgHandleReference layerControlHandle = null;
57
        private DwgHandleReference nullHandle = null;
58
        private DwgHandleReference plotstyleHandle = null;
59
        private DwgHandleReference linetypeHandle = null;
60
        private boolean frozen;
61
        private boolean on;
62
        private boolean frozenInNew;
63
        private boolean locked;
64
        
65
        /**
66
         * @return Returns the color.
67
         */
68
        public int getColor() {
69
                return color;
70
        }
71
        /**
72
         * @param color The color to set.
73
         */
74
        public void setColor(int color) {
75
                this.color = color;
76
        }
77
        /**
78
         * @return Returns the name.
79
         */
80
        public String getName() {
81
                return name;
82
        }
83
        /**
84
         * @param name The name to set.
85
         */
86
        public void setName(String name) {
87
                this.name = name;
88
        }
89
        /**
90
         * @return Returns the flag64.
91
         */
92
        public boolean isFlag64() {
93
                return flag64;
94
        }
95
        /**
96
         * @param flag64 The flag64 to set.
97
         */
98
        public void setFlag64(boolean flag64) {
99
                this.flag64 = flag64;
100
        }
101
        /**
102
         * @return Returns the xRefPlus.
103
         */
104
        public int getXRefPlus() {
105
                return xRefPlus;
106
        }
107
        /**
108
         * @param refPlus The xRefPlus to set.
109
         */
110
        public void setXRefPlus(int refPlus) {
111
                xRefPlus = refPlus;
112
        }
113
        /**
114
         * @return Returns the xdep.
115
         */
116
        public boolean isXdep() {
117
                return xdep;
118
        }
119
        /**
120
         * @param xdep The xdep to set.
121
         */
122
        public void setXdep(boolean xdep) {
123
                this.xdep = xdep;
124
        }
125
        /**
126
         * @return Returns the flags.
127
         */
128
        public int getFlags() {
129
                return flags;
130
        }
131
        /**
132
         * @param flags The flags to set.
133
         */
134
        public void setFlags(int flags) {
135
                this.flags = flags;
136
        }
137
        /**
138
         * @return Returns the layerControlHandle.
139
         */
140
        public DwgHandleReference getLayerControlHandle() {
141
                return layerControlHandle;
142
        }
143
        /**
144
         * @param layerControlHandle The layerControlHandle to set.
145
         */
146
        public void setLayerControlHandle(DwgHandleReference layerControlHandle) {
147
                this.layerControlHandle = layerControlHandle;
148
        }
149
        /**
150
         * @return Returns the nullHandle.
151
         */
152
        public DwgHandleReference getNullHandle() {
153
                return nullHandle;
154
        }
155
        /**
156
         * @param nullHandle The nullHandle to set.
157
         */
158
        public void setNullHandle(DwgHandleReference nullHandle) {
159
                this.nullHandle = nullHandle;
160
        }
161
        /**
162
         * @return Returns the linetypeHandle.
163
         */
164
        public DwgHandleReference getLinetypeHandle() {
165
                return linetypeHandle;
166
        }
167
        /**
168
         * @param linetypeHandle The linetypeHandle to set.
169
         */
170
        public void setLinetypeHandle(DwgHandleReference linetypeHandle) {
171
                this.linetypeHandle = linetypeHandle;
172
        }
173
        /**
174
         * @return Returns the plotstyleHandle.
175
         */
176
        public DwgHandleReference getPlotstyleHandle() {
177
                return plotstyleHandle;
178
        }
179
        /**
180
         * @param plotstyleHandle The plotstyleHandle to set.
181
         */
182
        public void setPlotstyleHandle(DwgHandleReference plotstyleHandle) {
183
                this.plotstyleHandle = plotstyleHandle;
184
        }
185
        public void setFrozen(boolean frozen) {
186
                this.frozen = frozen;
187
        }
188
        public void setOn(boolean on) {
189
                this.on = on;
190
        }
191
        public void setFrozenInNew(boolean frozenInNew) {
192
                this.frozenInNew = frozenInNew;
193
        }
194
        public void setLocked(boolean locked) {
195
                this.locked = locked;
196
        }
197
        public boolean isFrozen() {
198
                return frozen;
199
        }
200
        public boolean isFrozenInNew() {
201
                return frozenInNew;
202
        }
203
        public boolean isLocked() {
204
                return locked;
205
        }
206
        public boolean isOn() {
207
                return on;
208
        }
209
        
210
        public Object clone(){
211
                DwgLayer obj = new DwgLayer(index);
212
                this.fill(obj);
213
                return obj;
214
        }
215
        
216
        protected void fill(DwgObject obj){
217
                super.fill(obj);
218
                DwgLayer myObj = (DwgLayer)obj;
219

    
220
                myObj.setColor(color);
221
                myObj.setFlag64(flag64);
222
                myObj.setFlags(flags);
223
                myObj.setFrozen(frozen);
224
                myObj.setFrozenInNew(frozenInNew);
225
                myObj.setLayerControlHandle(layerControlHandle);
226
                myObj.setLinetypeHandle(linetypeHandle);
227
                myObj.setLocked(locked);
228
                myObj.setName(name);
229
                myObj.setNullHandle(nullHandle);
230
                myObj.setOn(on);
231
                myObj.setPlotstyleHandle(plotstyleHandle);
232
                myObj.setXdep(xdep);
233
                myObj.setXRefPlus(xRefPlus);
234

    
235
        }
236

    
237
}