public static class Path2D.Float extends Path2D implements Serializable
Float
class defines a geometric path with
coordinates stored in single precision floating point.Path2D.Double, Path2D.Float
WIND_EVEN_ODD, WIND_NON_ZERO
Constructor and Description |
---|
Path2D.Float()
Constructs a new empty single precision
Path2D object
with a default winding rule of Path2D.WIND_NON_ZERO . |
Path2D.Float(int rule)
Constructs a new empty single precision
Path2D object
with the specified winding rule to control operations that
require the interior of the path to be defined. |
Path2D.Float(int rule,
int initialCapacity)
Constructs a new empty single precision
Path2D object
with the specified winding rule and the specified initial
capacity to store path segments. |
Path2D.Float(Shape s)
Constructs a new single precision
Path2D object
from an arbitrary Shape object. |
Path2D.Float(Shape s,
AffineTransform at)
Constructs a new single precision
Path2D object
from an arbitrary Shape object, transformed by an
AffineTransform object. |
Modifier and Type | Method and Description |
---|---|
void |
append(PathIterator pi,
boolean connect)
Appends the geometry of the specified
PathIterator object
to the path, possibly connecting the new geometry to the existing
path segments with a line segment. |
Object |
clone()
Creates a new object of the same class as this object.
|
void |
curveTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Adds a curved segment, defined by three new points, to the path by
drawing a Bézier curve that intersects both the current
coordinates and the specified coordinates
(x3,y3) ,
using the specified points (x1,y1) and (x2,y2) as
Bézier control points. |
void |
curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Adds a curved segment, defined by three new points, to the path by
drawing a Bézier curve that intersects both the current
coordinates and the specified coordinates
(x3,y3) ,
using the specified points (x1,y1) and (x2,y2) as
Bézier control points. |
Rectangle2D |
getBounds2D()
Returns a high precision and more accurate bounding box of
the
Shape than the getBounds method. |
PathIterator |
getPathIterator(AffineTransform at)
Returns an iterator object that iterates along the
Shape boundary and provides access to the geometry of the
Shape outline. |
void |
lineTo(double x,
double y)
Adds a point to the path by drawing a straight line from the
current coordinates to the new specified coordinates
specified in double precision.
|
void |
lineTo(float x,
float y)
Adds a point to the path by drawing a straight line from the
current coordinates to the new specified coordinates
specified in float precision.
|
void |
moveTo(double x,
double y)
Adds a point to the path by moving to the specified
coordinates specified in double precision.
|
void |
moveTo(float x,
float y)
Adds a point to the path by moving to the specified
coordinates specified in float precision.
|
void |
quadTo(double x1,
double y1,
double x2,
double y2)
Adds a curved segment, defined by two new points, to the path by
drawing a Quadratic curve that intersects both the current
coordinates and the specified coordinates
(x2,y2) ,
using the specified point (x1,y1) as a quadratic
parametric control point. |
void |
quadTo(float x1,
float y1,
float x2,
float y2)
Adds a curved segment, defined by two new points, to the path by
drawing a Quadratic curve that intersects both the current
coordinates and the specified coordinates
(x2,y2) ,
using the specified point (x1,y1) as a quadratic
parametric control point. |
void |
transform(AffineTransform at)
Transforms the geometry of this path using the specified
AffineTransform . |
append, closePath, contains, contains, contains, contains, contains, contains, contains, contains, createTransformedShape, getBounds, getCurrentPoint, getPathIterator, getWindingRule, intersects, intersects, intersects, intersects, reset, setWindingRule
public Path2D.Float()
Path2D
object
with a default winding rule of Path2D.WIND_NON_ZERO
.public Path2D.Float(int rule)
Path2D
object
with the specified winding rule to control operations that
require the interior of the path to be defined.rule
- the winding rulePath2D.WIND_EVEN_ODD
,
Path2D.WIND_NON_ZERO
public Path2D.Float(int rule, int initialCapacity)
Path2D
object
with the specified winding rule and the specified initial
capacity to store path segments.
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.rule
- the winding ruleinitialCapacity
- the estimate for the number of path segments
in the pathPath2D.WIND_EVEN_ODD
,
Path2D.WIND_NON_ZERO