Java Doc for PathIterator.java in  » 6.0-JDK-Core » AWT » java » awt » geom » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt.geom 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.awt.geom.PathIterator

All known Subclasses:   java.awt.geom.EllipseIterator,  java.awt.geom.ArcIterator,  java.awt.geom.CubicIterator,  java.awt.geom.RoundRectIterator,  java.awt.geom.LineIterator,  java.awt.geom.RectIterator,  java.awt.geom.QuadIterator,  java.awt.geom.FlatteningPathIterator,
PathIterator
public interface PathIterator (Code)
The PathIterator interface provides the mechanism for objects that implement the java.awt.Shape Shape interface to return the geometry of their boundary by allowing a caller to retrieve the path of that boundary a segment at a time. This interface allows these objects to retrieve the path of their boundary a segment at a time by using 1st through 3rd order Bézier curves, which are lines and quadratic or cubic Bézier splines.

Multiple subpaths can be expressed by using a "MOVETO" segment to create a discontinuity in the geometry to move from the end of one subpath to the beginning of the next.

Each subpath can be closed manually by ending the last segment in the subpath on the same coordinate as the beginning "MOVETO" segment for that subpath or by using a "CLOSE" segment to append a line segment from the last point back to the first. Be aware that manually closing an outline as opposed to using a "CLOSE" segment to close the path might result in different line style decorations being used at the end points of the subpath. For example, the java.awt.BasicStroke BasicStroke object uses a line "JOIN" decoration to connect the first and last points if a "CLOSE" segment is encountered, whereas simply ending the path on the same coordinate as the beginning coordinate results in line "CAP" decorations being used at the ends.
See Also:   java.awt.Shape
See Also:   java.awt.BasicStroke
version:
   1.23, 05/05/07
author:
   Jim Graham



Field Summary
final public static  intSEG_CLOSE
     The segment type constant that specifies that the preceding subpath should be closed by appending a line segment back to the point corresponding to the most recent SEG_MOVETO.
final public static  intSEG_CUBICTO
     The segment type constant for the set of 3 points that specify a cubic parametric curve to be drawn from the most recently specified point.
final public static  intSEG_LINETO
     The segment type constant for a point that specifies the end point of a line to be drawn from the most recently specified point.
final public static  intSEG_MOVETO
     The segment type constant for a point that specifies the starting location for a new subpath.
final public static  intSEG_QUADTO
     The segment type constant for the pair of points that specify a quadratic parametric curve to be drawn from the most recently specified point.
final public static  intWIND_EVEN_ODD
     The winding rule constant for specifying an even-odd rule for determining the interior of a path.
final public static  intWIND_NON_ZERO
     The winding rule constant for specifying a non-zero rule for determining the interior of a path.


Method Summary
public  intcurrentSegment(float[] coords)
     Returns the coordinates and type of the current path segment in the iteration.
public  intcurrentSegment(double[] coords)
     Returns the coordinates and type of the current path segment in the iteration.
public  intgetWindingRule()
     Returns the winding rule for determining the interior of the path.
public  booleanisDone()
     Tests if the iteration is complete.
public  voidnext()
     Moves the iterator to the next segment of the path forwards along the primary direction of traversal as long as there are more points in that direction.

Field Detail
SEG_CLOSE
final public static int SEG_CLOSE(Code)
The segment type constant that specifies that the preceding subpath should be closed by appending a line segment back to the point corresponding to the most recent SEG_MOVETO.



SEG_CUBICTO
final public static int SEG_CUBICTO(Code)
The segment type constant for the set of 3 points that specify a cubic parametric curve to be drawn from the most recently specified point. The curve is interpolated by solving the parametric control equation in the range (t=[0..1]) using the most recently specified (current) point (CP), the first control point (P1), the second control point (P2), and the final interpolated control point (P3). The parametric control equation for this curve is:
 P(t) = B(3,0)*CP + B(3,1)*P1 + B(3,2)*P2 + B(3,3)*P3
 0 <= t <= 1
 B(n,m) = mth coefficient of nth degree Bernstein polynomial
 = C(n,m) * t^(m) * (1 - t)^(n-m)
 C(n,m) = Combinations of n things, taken m at a time
 = n! / (m! * (n-m)!)
 
This form of curve is commonly known as a Bézier curve.



SEG_LINETO
final public static int SEG_LINETO(Code)
The segment type constant for a point that specifies the end point of a line to be drawn from the most recently specified point.



SEG_MOVETO
final public static int SEG_MOVETO(Code)
The segment type constant for a point that specifies the starting location for a new subpath.



SEG_QUADTO
final public static int SEG_QUADTO(Code)
The segment type constant for the pair of points that specify a quadratic parametric curve to be drawn from the most recently specified point. The curve is interpolated by solving the parametric control equation in the range (t=[0..1]) using the most recently specified (current) point (CP), the first control point (P1), and the final interpolated control point (P2). The parametric control equation for this curve is:
 P(t) = B(2,0)*CP + B(2,1)*P1 + B(2,2)*P2
 0 <= t <= 1
 B(n,m) = mth coefficient of nth degree Bernstein polynomial
 = C(n,m) * t^(m) * (1 - t)^(n-m)
 C(n,m) = Combinations of n things, taken m at a time
 = n! / (m! * (n-m)!)
 



WIND_EVEN_ODD
final public static int WIND_EVEN_ODD(Code)
The winding rule constant for specifying an even-odd rule for determining the interior of a path. The even-odd rule specifies that a point lies inside the path if a ray drawn in any direction from that point to infinity is crossed by path segments an odd number of times.



WIND_NON_ZERO
final public static int WIND_NON_ZERO(Code)
The winding rule constant for specifying a non-zero rule for determining the interior of a path. The non-zero rule specifies that a point lies inside the path if a ray drawn in any direction from that point to infinity is crossed by path segments a different number of times in the counter-clockwise direction than the clockwise direction.





Method Detail
currentSegment
public int currentSegment(float[] coords)(Code)
Returns the coordinates and type of the current path segment in the iteration. The return value is the path-segment type: SEG_MOVETO, SEG_LINETO, SEG_QUADTO, SEG_CUBICTO, or SEG_CLOSE. A float array of length 6 must be passed in and can be used to store the coordinates of the point(s). Each point is stored as a pair of float x,y coordinates. SEG_MOVETO and SEG_LINETO types returns one point, SEG_QUADTO returns two points, SEG_CUBICTO returns 3 points and SEG_CLOSE does not return any points.
Parameters:
  coords - an array that holds the data returned fromthis method the path-segment type of the current path segment.
See Also:   PathIterator.SEG_MOVETO
See Also:   PathIterator.SEG_LINETO
See Also:   PathIterator.SEG_QUADTO
See Also:   PathIterator.SEG_CUBICTO
See Also:   PathIterator.SEG_CLOSE



currentSegment
public int currentSegment(double[] coords)(Code)
Returns the coordinates and type of the current path segment in the iteration. The return value is the path-segment type: SEG_MOVETO, SEG_LINETO, SEG_QUADTO, SEG_CUBICTO, or SEG_CLOSE. A double array of length 6 must be passed in and can be used to store the coordinates of the point(s). Each point is stored as a pair of double x,y coordinates. SEG_MOVETO and SEG_LINETO types returns one point, SEG_QUADTO returns two points, SEG_CUBICTO returns 3 points and SEG_CLOSE does not return any points.
Parameters:
  coords - an array that holds the data returned fromthis method the path-segment type of the current path segment.
See Also:   PathIterator.SEG_MOVETO
See Also:   PathIterator.SEG_LINETO
See Also:   PathIterator.SEG_QUADTO
See Also:   PathIterator.SEG_CUBICTO
See Also:   PathIterator.SEG_CLOSE



getWindingRule
public int getWindingRule()(Code)
Returns the winding rule for determining the interior of the path. the winding rule.
See Also:   PathIterator.WIND_EVEN_ODD
See Also:   PathIterator.WIND_NON_ZERO



isDone
public boolean isDone()(Code)
Tests if the iteration is complete. true if all the segments have been read; false otherwise.



next
public void next()(Code)
Moves the iterator to the next segment of the path forwards along the primary direction of traversal as long as there are more points in that direction.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.