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