Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / primitive / GeneralPathX.java @ 40388

History | View | Annotate | Download (6.49 KB)

1
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 geonetry,
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
    public GeneralPathX() {
48
            this.implementation = GeometryLocator.getGeometryManager().createGeneralPath(WIND_EVEN_ODD, null);
49
    }
50

    
51
    public GeneralPathX(int rule) {
52
            this.implementation = GeometryLocator.getGeometryManager().createGeneralPath(rule, null);
53
    }
54

    
55
    public GeneralPathX(int rule, int initialCapacity) {
56
            this.implementation = GeometryLocator.getGeometryManager().createGeneralPath(rule, null);
57
    }
58

    
59
    public GeneralPathX(PathIterator pathIterator) {
60
            this.implementation = GeometryLocator.getGeometryManager().createGeneralPath(WIND_EVEN_ODD, pathIterator);
61
    }
62

    
63
    public synchronized void moveTo(double x, double y) {
64
            this.implementation.moveTo(x, y);
65
    }
66

    
67
    public synchronized void moveTo(Point point) {
68
            this.implementation.moveTo(point);
69
    }
70

    
71
    public synchronized void lineTo(double x, double y) {
72
            this.implementation.lineTo(x, y);
73
    }
74

    
75
    public synchronized void lineTo(Point point) {
76
            this.implementation.lineTo(point);
77
    }
78

    
79
    public synchronized void addSegment(Point[] segment) {
80
            this.implementation.addSegment(segment);
81
    }
82

    
83
    public synchronized void quadTo(double x1, double y1, double x2, double y2) {
84
            this.implementation.quadTo(x1, y1, x2, y2);
85
    }
86

    
87
    public synchronized void quadTo(Point point1, Point point2) {
88
            this.implementation.quadTo(point1, point2);
89
    }
90

    
91
    public synchronized void curveTo(double x1, double y1, double x2,
92
        double y2, double x3, double y3) {
93
            this.implementation.curveTo(x1, y1, x2, y2, x3, y3);
94
    }
95

    
96
    public synchronized void curveTo(Point point1, Point point2, Point point3) {
97
            this.implementation.curveTo(point1, point2, point3);
98
    }
99

    
100
    public synchronized void closePath() {
101
            this.implementation.closePath();
102
    }
103

    
104
    public boolean isClosed() {
105
            return this.implementation.isClosed();
106
    }
107

    
108
    public void append(PathIterator pi, boolean connect) {
109
            this.implementation.append(pi, connect);
110
    }
111

    
112
    public void setWindingRule(int rule) {
113
            this.implementation.setWindingRule(rule);
114
    }
115

    
116
    public synchronized void reset() {
117
            this.implementation.reset();
118
    }
119

    
120
    public void transform(AffineTransform at) {
121
            this.implementation.transform(at);
122
    }
123

    
124
    public void reProject(ICoordTrans ct) {
125
            this.implementation.reProject(ct);
126
    }
127

    
128
    public void setNumTypes(int numTypes) {
129
            this.implementation.setNumTypes(numTypes);
130
    }
131

    
132
    public void setPointTypes(byte[] pointTypes) {
133
            this.implementation.setPointTypes(pointTypes);
134
    }
135

    
136
    public void setPointCoords(double[] pointCoords) {
137
            this.implementation.setPointCoords(pointCoords);
138
    }
139

    
140
    public void flip() {
141
            this.implementation.flip();
142
    }
143

    
144
    public synchronized Point2D getCurrentPoint() {
145
            return this.implementation.getCurrentPoint();
146
    }
147

    
148
    public synchronized int getWindingRule() {
149
            return this.implementation.getWindingRule();
150
    }
151

    
152
    public synchronized Shape createTransformedShape(AffineTransform at) {
153
            return this.implementation.createTransformedShape(at);
154
    }
155

    
156
    public java.awt.Rectangle getBounds() {
157
            return this.implementation.getBounds();
158
    }
159

    
160
    public synchronized Rectangle2D getBounds2D() {
161
            return this.implementation.getBounds2D();
162
    }
163

    
164
    public boolean contains(double x, double y) {
165
            return this.implementation.contains(x, y);
166
    }
167

    
168
    public boolean contains(Point2D p) {
169
            return this.implementation.contains(p);
170
    }
171

    
172
    public boolean contains(double x, double y, double w, double h) {
173
            return this.implementation.contains(x, y, w, h);
174
    }
175

    
176
    public boolean contains(Rectangle2D r) {
177
            return this.implementation.contains(r);
178
    }
179

    
180
    public boolean intersects(double x, double y, double w, double h) {
181
            return this.implementation.intersects(x, y, w, h);
182
    }
183

    
184
    public boolean intersects(Rectangle2D r) {
185
            return this.implementation.intersects(r);
186
    }
187

    
188
    public PathIterator getPathIterator(AffineTransform at) {
189
            return this.implementation.getPathIterator(at);
190
    }
191

    
192
    public PathIterator getPathIterator(AffineTransform at, double flatness) {
193
            return this.implementation.getPathIterator(at, flatness);
194
    }
195

    
196
    public Object clone() {
197
            return this.implementation.clone();
198
    }
199

    
200
    public int getNumTypes() {
201
            return this.implementation.getNumTypes();
202
    }
203

    
204
    public int setNumCoords(int numCoords) {
205
            return this.implementation.setNumCoords(numCoords);
206
    }
207

    
208
    public int getNumCoords() {
209
            return this.implementation.getNumCoords();
210
    }
211

    
212
    public byte getTypeAt(int index) {
213
            return this.implementation.getTypeAt(index);
214
    }
215

    
216
    public byte[] getPointTypes() {
217
            return this.implementation.getPointTypes();
218
    }
219

    
220
    public double[] getPointCoords() {
221
            return this.implementation.getPointCoords();
222
    }
223

    
224
    public Point getPointAt(int index) {
225
            return this.implementation.getPointAt(index);
226
    }
227

    
228
    public double[] getCoordinatesAt(int index) {
229
            return this.implementation.getCoordinatesAt(index);
230
    }
231

    
232
    public boolean isCCW() {
233
            return this.implementation.isCCW();
234
    }
235

    
236
    public boolean isSimple() {
237
            return this.implementation.isSimple();
238
    }
239
}