问题
I hope it is not a silly question:
What is path, subpath, and endpoint in Java2D?
回答1:
Most commonly, a path is a combination of lines and cubic Bezier segments. This is represented procedurally by a sequence of moveTo, lineTo, curveTo, and closePath methods. These correspond to the operators of the same name in PostScript (but lowercased), from which the Java2D imaging model derives. (Also, there is quadTo, which is a quadratic Bezier segment, but this is less important and easily simulated by curveTo if needed).
A subpath is a connected sequence of segments. It doesn't have its own class, but a GeneralPath object can contain multiple subpaths, each beginning with its own moveTo().
Endpoints are the points at the ends of each line segment. Their (x, y) coordinates are the arguments to moveTo and lineTo, and the last two arguments to curveTo (the other arguments are "control points" which affect the shape of the curve segment but not the endpoints).
Hope this enlightens.
来源:https://stackoverflow.com/questions/4662295/what-is-path-subpath-in-java2d