KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > ext > awt > geom > ExtendedPathIterator


1 /*
2
3    Copyright 2002-2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.ext.awt.geom;
19
20 import java.awt.geom.PathIterator JavaDoc;
21
22 /**
23  * The <code>ExtendedPathIterator</code> class represents a geometric
24  * path constructed from straight lines, quadratic and cubic (Bezier)
25  * curves and elliptical arcs. This interface is identical to that of
26  * PathIterator except it can return SEG_ARCTO from currentSegment,
27  * also the array of values passed to currentSegment must be of length
28  * 7 or an error will be thrown.
29  *
30  * This does not extend PathIterator as it would break the interface
31  * contract for that class.
32  *
33  * @author <a HREF="mailto:deweese@apache.org">Thomas DeWeese</a>
34  * @version $Id: ExtendedPathIterator.java,v 1.4 2004/08/18 07:13:47 vhardy Exp $ */

35 public interface ExtendedPathIterator {
36
37     /**
38      * The segment type constant that specifies that the preceding
39      * subpath should be closed by appending a line segment back to
40      * the point corresponding to the most recent SEG_MOVETO.
41      */

42     public static final int SEG_CLOSE = PathIterator.SEG_CLOSE;
43     /**
44      * The segment type constant for a point that specifies the end
45      * point of a line to be drawn from the most recently specified
46      * point. */

47     public static final int SEG_MOVETO = PathIterator.SEG_MOVETO;
48     /**
49      * The segment type constant for a point that specifies the end
50      * point of a line to be drawn from the most recently specified
51      * point.
52      */

53     public static final int SEG_LINETO = PathIterator.SEG_LINETO;
54     /**
55      * The segment type constant for the pair of points that specify a
56      * quadratic parametric curve to be drawn from the most recently
57      * specified point. The curve is interpolated by solving the
58      * parametric control equation in the range (t=[0..1]) using the
59      * most recently specified (current) point (CP), the first control
60      * point (P1), and the final interpolated control point (P2).
61      */

62     public static final int SEG_QUADTO = PathIterator.SEG_QUADTO;
63     /**
64      * The segment type constant for the set of 3 points that specify
65      * a cubic parametric curve to be drawn from the most recently
66      * specified point. The curve is interpolated by solving the
67      * parametric control equation in the range (t=[0..1]) using the
68      * most recently specified (current) point (CP), the first control
69      * point (P1), the second control point (P2), and the final
70      * interpolated control point (P3).
71      */

72     public static final int SEG_CUBICTO = PathIterator.SEG_CUBICTO;
73
74     /** The segment type constant for an elliptical arc. This consists of
75      * Seven values [rx, ry, angle, largeArcFlag, sweepFlag, x, y].
76      * rx, ry are the radious of the ellipse.
77      * angle is angle of the x axis of the ellipse.
78      * largeArcFlag is zero if the smaller of the two arcs are to be used.
79      * sweepFlag is zero if the 'left' branch is taken one otherwise.
80      * x and y are the destination for the ellipse. */

81     public static final int SEG_ARCTO = 4321;
82
83     /** The winding rule constant for specifying an even-odd rule for
84      * determining the interior of a path. The even-odd rule specifies
85      * that a point lies inside the path if a ray drawn in any
86      * direction from that point to infinity is crossed by path
87      * segments an odd number of times.
88      */

89     public static final int WIND_EVEN_ODD = PathIterator.WIND_EVEN_ODD;
90     /**
91      * The winding rule constant for specifying a non-zero rule for
92      * determining the interior of a path. The non-zero rule specifies
93      * that a point lies inside the path if a ray drawn in any
94      * direction from that point to infinity is crossed by path
95      * segments a different number of times in the counter-clockwise
96      * direction than the clockwise direction.
97      */

98      public static final int WIND_NON_ZERO = PathIterator.WIND_NON_ZERO;
99
100
101     public int currentSegment(double[] coords);
102     public int currentSegment(float[] coords);
103     public int getWindingRule();
104     public boolean isDone();
105     public void next();
106 }
107
108
Popular Tags