public final class GeneralPath extends Path2D.Float
GeneralPath类代表由直线构成的几何路径,以及二次和立方(Bézier)曲线。
它可以包含多个子路径。
GeneralPath是正是实现其超类的行为遗留final类Path2D.Float 。 与Path2D.Double一起, Path2D类提供了一般几何路径的全面实现,支持Shape和PathIterator接口的所有功能,具有明确选择不同级别的内部坐标精度的能力。
当处理可以用浮点精度表示和使用的数据时,使用Path2D.Float (或这个传统的GeneralPath子类)。 使用Path2D.Double对于需要双精度的准确性或范围的数据。
Path2D.Double, Path2D.FloatWIND_EVEN_ODD, WIND_NON_ZERO| Constructor and Description |
|---|
GeneralPath()
构造一个新的空单精度
GeneralPath对象,默认绕组规则为
Path2D.WIND_NON_ZERO 。
|
GeneralPath(int rule)
使用指定的绕组规则构造一个新的
GeneralPath对象,以控制需要定义路径内部的操作。
|
GeneralPath(int rule, int initialCapacity)
构造一个新的
GeneralPath对象,具有指定的绕组规则和指定的初始容量以存储路径坐标。
|
GeneralPath(Shape s)
构造一个新 GeneralPath从任意对象Shape对象。
|
append, clone, curveTo, curveTo, getBounds2D, getPathIterator, lineTo, lineTo, moveTo, moveTo, quadTo, quadTo, transformappend, closePath, contains, contains, contains, contains, contains, contains, contains, contains, createTransformedShape, getBounds, getCurrentPoint, getPathIterator, getWindingRule, intersects, intersects, intersects, intersects, reset, setWindingRulepublic GeneralPath()
GeneralPath对象,默认卷绕规则为
Path2D.WIND_NON_ZERO 。
public GeneralPath(int rule)
GeneralPath对象,以控制需要定义路径内部的操作。
rule - 绕线规则
Path2D.WIND_EVEN_ODD ,
Path2D.WIND_NON_ZERO
public GeneralPath(int rule,
int initialCapacity)
GeneralPath对象,具有指定的绕组规则和指定的初始容量以存储路径坐标。
这个数字是关于将多少路径段添加到路径的初步猜测,但根据需要扩展存储,以存储添加的任何路径段。
rule - 缠绕规则
initialCapacity - 路径中路径段数量的估计
Path2D.WIND_EVEN_ODD ,
Path2D.WIND_NON_ZERO
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.