GeneralPath (Java Platform SE 6) (original) (raw)
java.awt.geom
Class GeneralPath
java.lang.Object
java.awt.geom.Path2D
java.awt.geom.Path2D.Float
java.awt.geom.GeneralPath
All Implemented Interfaces:
Shape, Serializable, Cloneable
public final class GeneralPath
extends Path2D.Float
The GeneralPath
class represents a geometric path constructed from straight lines, and quadratic and cubic (Bézier) curves. It can contain multiple subpaths.
GeneralPath
is a legacy final class which exactly implements the behavior of its superclass Path2D.Float. Together with Path2D.Double, the Path2D classes provide full implementations of a general geometric path that support all of the functionality of the Shape andPathIterator interfaces with the ability to explicitly select different levels of internal coordinate precision.
Use Path2D.Float
(or this legacy GeneralPath
subclass) when dealing with data that can be represented and used with floating point precision. Use Path2D.Double
for data that requires the accuracy or range of double precision.
Since:
1.2
See Also:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Path2D |
---|
Path2D.Double, Path2D.Float |
Field Summary |
---|
Fields inherited from class java.awt.geom.Path2D |
---|
WIND_EVEN_ODD, WIND_NON_ZERO |
Constructor Summary |
---|
GeneralPath() Constructs a new empty single precision GeneralPath object with a default winding rule of Path2D.WIND_NON_ZERO. |
GeneralPath(int rule) Constructs a new GeneralPath object with the specified winding rule to control operations that require the interior of the path to be defined. |
[GeneralPath](../../../java/awt/geom/GeneralPath.html#GeneralPath%28int, int%29)(int rule, int initialCapacity) Constructs a new GeneralPath object with the specified winding rule and the specified initial capacity to store path coordinates. |
GeneralPath(Shape s) Constructs a new GeneralPath object from an arbitrary Shape object. |
Method Summary |
---|
Methods inherited from class java.awt.geom.Path2D.Float |
---|
[append](../../../java/awt/geom/Path2D.Float.html#append%28java.awt.geom.PathIterator, boolean%29), clone, [curveTo](../../../java/awt/geom/Path2D.Float.html#curveTo%28double, double, double, double, double, double%29), [curveTo](../../../java/awt/geom/Path2D.Float.html#curveTo%28float, float, float, float, float, float%29), getBounds2D, getPathIterator, [lineTo](../../../java/awt/geom/Path2D.Float.html#lineTo%28double, double%29), [lineTo](../../../java/awt/geom/Path2D.Float.html#lineTo%28float, float%29), [moveTo](../../../java/awt/geom/Path2D.Float.html#moveTo%28double, double%29), [moveTo](../../../java/awt/geom/Path2D.Float.html#moveTo%28float, float%29), [quadTo](../../../java/awt/geom/Path2D.Float.html#quadTo%28double, double, double, double%29), [quadTo](../../../java/awt/geom/Path2D.Float.html#quadTo%28float, float, float, float%29), transform |
Methods inherited from class java.awt.geom.Path2D |
---|
[append](../../../java/awt/geom/Path2D.html#append%28java.awt.Shape, boolean%29), closePath, [contains](../../../java/awt/geom/Path2D.html#contains%28double, double%29), [contains](../../../java/awt/geom/Path2D.html#contains%28double, double, double, double%29), [contains](../../../java/awt/geom/Path2D.html#contains%28java.awt.geom.PathIterator, double, double%29), [contains](../../../java/awt/geom/Path2D.html#contains%28java.awt.geom.PathIterator, double, double, double, double%29), [contains](../../../java/awt/geom/Path2D.html#contains%28java.awt.geom.PathIterator, java.awt.geom.Point2D%29), [contains](../../../java/awt/geom/Path2D.html#contains%28java.awt.geom.PathIterator, java.awt.geom.Rectangle2D%29), contains, contains, createTransformedShape, getBounds, getCurrentPoint, [getPathIterator](../../../java/awt/geom/Path2D.html#getPathIterator%28java.awt.geom.AffineTransform, double%29), getWindingRule, [intersects](../../../java/awt/geom/Path2D.html#intersects%28double, double, double, double%29), [intersects](../../../java/awt/geom/Path2D.html#intersects%28java.awt.geom.PathIterator, double, double, double, double%29), [intersects](../../../java/awt/geom/Path2D.html#intersects%28java.awt.geom.PathIterator, java.awt.geom.Rectangle2D%29), intersects, reset, setWindingRule |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, [wait](../../../java/lang/Object.html#wait%28long, int%29) |
Constructor Detail |
---|
GeneralPath
public GeneralPath()
Constructs a new empty single precision GeneralPath
object with a default winding rule of Path2D.WIND_NON_ZERO.
Since:
1.2
GeneralPath
public GeneralPath(int rule)
Constructs a new GeneralPath
object with the specified winding rule to control operations that require the interior of the path to be defined.
Parameters:
rule
- the winding rule
Since:
1.2
See Also:
Path2D.WIND_EVEN_ODD, Path2D.WIND_NON_ZERO
GeneralPath
public GeneralPath(int rule, int initialCapacity)
Constructs a new GeneralPath
object with the specified winding rule and the specified initial capacity to store path coordinates. This number is an initial guess as to how many path segments will be added to the path, but the storage is expanded as needed to store whatever path segments are added.
Parameters:
rule
- the winding rule
initialCapacity
- the estimate for the number of path segments in the path
Since:
1.2
See Also:
Path2D.WIND_EVEN_ODD, Path2D.WIND_NON_ZERO
GeneralPath
public GeneralPath(Shape s)
Constructs a new GeneralPath
object from an arbitrary Shape object. All of the initial geometry and the winding rule for this path are taken from the specified Shape
object.
Parameters:
s
- the specified Shape
object
Since:
1.2
Submit a bug or feature
For further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
Scripting on this page tracks web page traffic, but does not change the content in any way.