svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.api / src / main / java / org / gvsig / fmap / geom / primitive / GeneralPathX.java @ 40559
History | View | Annotate | Download (8 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.geom.primitive; |
25 |
|
26 |
import java.awt.Shape; |
27 |
import java.awt.geom.AffineTransform; |
28 |
import java.awt.geom.PathIterator; |
29 |
import java.awt.geom.Point2D; |
30 |
import java.awt.geom.Rectangle2D; |
31 |
import java.io.Serializable; |
32 |
|
33 |
import org.cresques.cts.ICoordTrans; |
34 |
import org.gvsig.fmap.geom.GeometryLocator; |
35 |
|
36 |
/**
|
37 |
*
|
38 |
* This class is deprecated.
|
39 |
* Use the API of Geometry to manipulate the geometry,
|
40 |
*
|
41 |
* @deprecated use the geometry methods
|
42 |
*/
|
43 |
public class GeneralPathX implements Shape, Cloneable, Serializable { |
44 |
|
45 |
public static final int curvesize[] = { 1, 1, 2, 3, 0 }; |
46 |
|
47 |
/**
|
48 |
* An even-odd winding rule for determining the interior of
|
49 |
* a path.
|
50 |
*/
|
51 |
public static final int WIND_EVEN_ODD = PathIterator.WIND_EVEN_ODD; |
52 |
|
53 |
/**
|
54 |
* A non-zero winding rule for determining the interior of a
|
55 |
* path.
|
56 |
*/
|
57 |
public static final int WIND_NON_ZERO = PathIterator.WIND_NON_ZERO; |
58 |
|
59 |
public static final byte SEG_MOVETO = (byte) PathIterator.SEG_MOVETO; |
60 |
public static final byte SEG_LINETO = (byte) PathIterator.SEG_LINETO; |
61 |
public static final byte SEG_QUADTO = (byte) PathIterator.SEG_QUADTO; |
62 |
public static final byte SEG_CUBICTO = (byte) PathIterator.SEG_CUBICTO; |
63 |
public static final byte SEG_CLOSE = (byte) PathIterator.SEG_CLOSE; |
64 |
|
65 |
|
66 |
protected static final int INIT_SIZE = 20; |
67 |
|
68 |
private GeneralPathX implementation = null; |
69 |
|
70 |
protected GeneralPathX(boolean nouse) { |
71 |
super();
|
72 |
} |
73 |
|
74 |
/**
|
75 |
* @deprecated to create a GeneralPathX use GeometryManager.createGeneralPath
|
76 |
*/
|
77 |
public GeneralPathX() {
|
78 |
this.implementation = GeometryLocator.getGeometryManager().createGeneralPath(WIND_EVEN_ODD, null); |
79 |
} |
80 |
|
81 |
/**
|
82 |
* @deprecated to create a GeneralPathX use GeometryManager.createGeneralPath
|
83 |
*/
|
84 |
public GeneralPathX(int rule) { |
85 |
this.implementation = GeometryLocator.getGeometryManager().createGeneralPath(rule, null); |
86 |
} |
87 |
|
88 |
/**
|
89 |
* @deprecated to create a GeneralPathX use GeometryManager.createGeneralPath
|
90 |
*/
|
91 |
public GeneralPathX(int rule, int initialCapacity) { |
92 |
this.implementation = GeometryLocator.getGeometryManager().createGeneralPath(rule, null); |
93 |
} |
94 |
|
95 |
/**
|
96 |
* @deprecated to create a GeneralPathX use GeometryManager.createGeneralPath
|
97 |
*/
|
98 |
public GeneralPathX(PathIterator pathIterator) { |
99 |
this.implementation = GeometryLocator.getGeometryManager().createGeneralPath(WIND_EVEN_ODD, pathIterator);
|
100 |
} |
101 |
|
102 |
public synchronized void moveTo(double x, double y) { |
103 |
this.implementation.moveTo(x, y);
|
104 |
} |
105 |
|
106 |
public synchronized void moveTo(Point point) { |
107 |
this.implementation.moveTo(point);
|
108 |
} |
109 |
|
110 |
public synchronized void lineTo(double x, double y) { |
111 |
this.implementation.lineTo(x, y);
|
112 |
} |
113 |
|
114 |
public synchronized void lineTo(Point point) { |
115 |
this.implementation.lineTo(point);
|
116 |
} |
117 |
|
118 |
public synchronized void addSegment(Point[] segment) { |
119 |
this.implementation.addSegment(segment);
|
120 |
} |
121 |
|
122 |
public synchronized void quadTo(double x1, double y1, double x2, double y2) { |
123 |
this.implementation.quadTo(x1, y1, x2, y2);
|
124 |
} |
125 |
|
126 |
public synchronized void quadTo(Point point1, Point point2) { |
127 |
this.implementation.quadTo(point1, point2);
|
128 |
} |
129 |
|
130 |
public synchronized void curveTo(double x1, double y1, double x2, |
131 |
double y2, double x3, double y3) { |
132 |
this.implementation.curveTo(x1, y1, x2, y2, x3, y3);
|
133 |
} |
134 |
|
135 |
public synchronized void curveTo(Point point1, Point point2, Point point3) { |
136 |
this.implementation.curveTo(point1, point2, point3);
|
137 |
} |
138 |
|
139 |
public synchronized void closePath() { |
140 |
this.implementation.closePath();
|
141 |
} |
142 |
|
143 |
public boolean isClosed() { |
144 |
return this.implementation.isClosed(); |
145 |
} |
146 |
|
147 |
public void append(PathIterator pi, boolean connect) { |
148 |
this.implementation.append(pi, connect);
|
149 |
} |
150 |
|
151 |
public void setWindingRule(int rule) { |
152 |
this.implementation.setWindingRule(rule);
|
153 |
} |
154 |
|
155 |
public synchronized void reset() { |
156 |
this.implementation.reset();
|
157 |
} |
158 |
|
159 |
public void transform(AffineTransform at) { |
160 |
this.implementation.transform(at);
|
161 |
} |
162 |
|
163 |
public void reProject(ICoordTrans ct) { |
164 |
this.implementation.reProject(ct);
|
165 |
} |
166 |
|
167 |
public void setNumTypes(int numTypes) { |
168 |
this.implementation.setNumTypes(numTypes);
|
169 |
} |
170 |
|
171 |
public void setPointTypes(byte[] pointTypes) { |
172 |
this.implementation.setPointTypes(pointTypes);
|
173 |
} |
174 |
|
175 |
public void setPointCoords(double[] pointCoords) { |
176 |
this.implementation.setPointCoords(pointCoords);
|
177 |
} |
178 |
|
179 |
public void flip() { |
180 |
this.implementation.flip();
|
181 |
} |
182 |
|
183 |
public synchronized Point2D getCurrentPoint() { |
184 |
return this.implementation.getCurrentPoint(); |
185 |
} |
186 |
|
187 |
public synchronized int getWindingRule() { |
188 |
return this.implementation.getWindingRule(); |
189 |
} |
190 |
|
191 |
public synchronized Shape createTransformedShape(AffineTransform at) { |
192 |
return this.implementation.createTransformedShape(at); |
193 |
} |
194 |
|
195 |
public java.awt.Rectangle getBounds() {
|
196 |
return this.implementation.getBounds(); |
197 |
} |
198 |
|
199 |
public synchronized Rectangle2D getBounds2D() { |
200 |
return this.implementation.getBounds2D(); |
201 |
} |
202 |
|
203 |
public boolean contains(double x, double y) { |
204 |
return this.implementation.contains(x, y); |
205 |
} |
206 |
|
207 |
public boolean contains(Point2D p) { |
208 |
return this.implementation.contains(p); |
209 |
} |
210 |
|
211 |
public boolean contains(double x, double y, double w, double h) { |
212 |
return this.implementation.contains(x, y, w, h); |
213 |
} |
214 |
|
215 |
public boolean contains(Rectangle2D r) { |
216 |
return this.implementation.contains(r); |
217 |
} |
218 |
|
219 |
public boolean intersects(double x, double y, double w, double h) { |
220 |
return this.implementation.intersects(x, y, w, h); |
221 |
} |
222 |
|
223 |
public boolean intersects(Rectangle2D r) { |
224 |
return this.implementation.intersects(r); |
225 |
} |
226 |
|
227 |
public PathIterator getPathIterator(AffineTransform at) { |
228 |
return this.implementation.getPathIterator(at); |
229 |
} |
230 |
|
231 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
232 |
return this.implementation.getPathIterator(at, flatness); |
233 |
} |
234 |
|
235 |
public Object clone() { |
236 |
return this.implementation.clone(); |
237 |
} |
238 |
|
239 |
public int getNumTypes() { |
240 |
return this.implementation.getNumTypes(); |
241 |
} |
242 |
|
243 |
public int setNumCoords(int numCoords) { |
244 |
return this.implementation.setNumCoords(numCoords); |
245 |
} |
246 |
|
247 |
public int getNumCoords() { |
248 |
return this.implementation.getNumCoords(); |
249 |
} |
250 |
|
251 |
public byte getTypeAt(int index) { |
252 |
return this.implementation.getTypeAt(index); |
253 |
} |
254 |
|
255 |
public byte[] getPointTypes() { |
256 |
return this.implementation.getPointTypes(); |
257 |
} |
258 |
|
259 |
public double[] getPointCoords() { |
260 |
return this.implementation.getPointCoords(); |
261 |
} |
262 |
|
263 |
public Point getPointAt(int index) { |
264 |
return this.implementation.getPointAt(index); |
265 |
} |
266 |
|
267 |
public double[] getCoordinatesAt(int index) { |
268 |
return this.implementation.getCoordinatesAt(index); |
269 |
} |
270 |
|
271 |
public double[] get3DCoordinatesAt(int index) { |
272 |
return this.implementation.get3DCoordinatesAt(index); |
273 |
} |
274 |
|
275 |
public boolean isCCW() { |
276 |
return this.implementation.isCCW(); |
277 |
} |
278 |
|
279 |
public boolean isSimple() { |
280 |
return this.implementation.isSimple(); |
281 |
} |
282 |
} |