Statistics
| Revision:

root / trunk / libraries / libDwg / src / com / iver / cit / jdwglib / dwg / objects / DwgHatch.java @ 10356

History | View | Annotate | Download (4.41 KB)

1
/*
2
 * Created on 30-ene-2007
3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. 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
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 *
34
 *    or
35
 *
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 *
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
/* CVS MESSAGES:
45
*
46
* $Id: DwgHatch.java 10174 2007-02-07 12:44:27Z fdiaz $
47
* $Log$
48
* Revision 1.4  2007-02-07 12:44:27  fdiaz
49
* A?adido o modificado el metodo clone para que el DwgObject se encargue de las propiedades comunes a todos los objetos.
50
* A?adido el metodo fill.
51
*
52
* Revision 1.3  2007/02/02 12:39:52  azabala
53
* Added new dwg entities
54
*
55
* Revision 1.2  2007/02/01 20:00:27  azabala
56
* *** empty log message ***
57
*
58
* Revision 1.1  2007/01/30 19:40:23  azabala
59
* *** empty log message ***
60
*
61
*
62
*/
63
package com.iver.cit.jdwglib.dwg.objects;
64

    
65
import java.util.ArrayList;
66
import java.util.Map;
67

    
68
import com.iver.cit.jdwglib.dwg.DwgHandleReference;
69
import com.iver.cit.jdwglib.dwg.DwgObject;
70

    
71
public class DwgHatch extends DwgObject {
72

    
73
        private double z;
74
        private double[] extrusion;
75
        private String name;
76
        private boolean solidFill;
77
        private boolean associative;
78
        private Map paths;
79
        private int style;
80
        private int patternType;
81
        private double fillAngle;
82
        private double fillScaleOrSpace;
83
        private boolean fileDoubleHath;
84
        private ArrayList[] lines;
85
        private double pixelSize;
86
        private double[][] seedPoints;
87
        private DwgHandleReference[] handles;
88

    
89
        public DwgHatch(int index) {
90
                super(index);
91
        }
92

    
93
        public void setZ(double coord) {
94
                this.z = coord;
95
        }
96

    
97
        public void setExtrusion(double[] ds) {
98
                this.extrusion = ds;
99
        }
100

    
101
        public void setName(String txt) {
102
                this.name = txt;
103
        }
104

    
105
        public void setSolidFill(boolean solidFill) {
106
                this.solidFill = solidFill;
107
        }
108

    
109
        public void setAssociative(boolean associative) {
110
                this.associative = associative;
111
        }
112

    
113
        public void setPaths(Map paths) {
114
                this.paths = paths;
115
        }
116

    
117
        public void setStyle(int style) {
118
                this.style = style;
119
        }
120

    
121
        /**
122
         * @param patternType
123
         */
124
        public void setPatterType(int patternType) {
125
                this.patternType = patternType;
126
        }
127

    
128
        /**
129
         * @param fillAngle
130
         */
131
        public void setFillAngle(double fillAngle) {
132
                this.fillAngle = fillAngle;
133
        }
134

    
135
        /**
136
         * @param fillScaleOrSpacion
137
         */
138
        public void setFillScale(double fillScaleOrSpacion) {
139
                this.fillScaleOrSpace = fillScaleOrSpacion;
140
        }
141

    
142
        /**
143
         * @param fileDoubleHath
144
         */
145
        public void setFileDoubleHath(boolean fileDoubleHath) {
146
                this.fileDoubleHath = fileDoubleHath;
147
        }
148

    
149
        /**
150
         * @param lines
151
         */
152
        public void setFillLines(ArrayList[] lines) {
153
                this.lines = lines;
154
        }
155

    
156
        /**
157
         * @param pixelSize
158
         */
159
        public void setPixelSize(double pixelSize) {
160
                this.pixelSize = pixelSize;
161
        }
162

    
163
        /**
164
         * @param seedPoints
165
         */
166
        public void setSeedPoints(double[][] seedPoints) {
167
                this.seedPoints = seedPoints;
168
        }
169

    
170
        /**
171
         * @param handles
172
         */
173
        public void setBoundaryHandles(DwgHandleReference[] handles) {
174
                this.handles = handles;
175
        }
176

    
177
        public Object clone(){
178
                DwgHatch obj = new DwgHatch(index);
179
                this.fill(obj);
180
                return obj;
181
        }
182
        
183
        protected void fill(DwgObject obj){
184
                super.fill(obj);
185
                DwgHatch myObj = (DwgHatch)obj;
186

    
187
                myObj.setAssociative(associative);
188
                myObj.setBoundaryHandles(handles);
189
                myObj.setExtrusion(extrusion);
190
                myObj.setFileDoubleHath(fileDoubleHath);
191
                myObj.setFillAngle(fillAngle);
192
                myObj.setFillLines(lines);
193
                myObj.setFillScale(fillScaleOrSpace);
194
                myObj.setName(name);
195
                myObj.setPaths(paths);
196
                myObj.setPatterType(patternType);
197
                myObj.setPixelSize(pixelSize);
198
                myObj.setSeedPoints(seedPoints);
199
                myObj.setSolidFill(solidFill);
200
                myObj.setStyle(style);
201
                myObj.setZ(z);
202
        }
203

    
204
}
205