Constructor and Description |
---|
Area()
Creates an empty area.
|
Area(IShape s)
Creates an area from the supplied shape.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Area area)
Adds the supplied area to this area.
|
Rectangle |
bounds()
Returns a copy of the bounding rectangle for this shape.
|
Rectangle |
bounds(Rectangle target)
Initializes the supplied rectangle with this shape's bounding rectangle.
|
Area |
clone() |
boolean |
contains(double x,
double y)
Returns true if this shape contains the specified point.
|
boolean |
contains(double x,
double y,
double width,
double height)
Returns true if this shape completely contains the specified rectangle.
|
boolean |
contains(IRectangle r)
Returns true if this shape completely contains the supplied rectangle.
|
boolean |
contains(XY p)
Returns true if this shape contains the supplied point.
|
Area |
createTransformedArea(Transform t)
Creates a new area equal to this area transformed by the supplied transform.
|
boolean |
equals(Object obj) |
void |
exclusiveOr(Area area)
Computes the exclusive or of this area and the supplied area and sets this area to the
result.
|
void |
intersect(Area area)
Intersects the supplied area with this area.
|
boolean |
intersects(double x,
double y,
double width,
double height)
Returns true if this shape intersects the specified rectangle.
|
boolean |
intersects(IRectangle r)
Returns true if this shape intersects the supplied rectangle.
|
boolean |
isEmpty()
Returns true if this shape encloses no area.
|
boolean |
isPolygonal()
Returns true if this area is polygonal.
|
boolean |
isRectangular()
Returns true if this area is rectangular.
|
boolean |
isSingular()
Returns true if this area encloses only a single contiguous space.
|
PathIterator |
pathIterator(Transform t)
Returns an iterator over the path described by this shape.
|
PathIterator |
pathIterator(Transform t,
double flatness)
Returns an iterator over the path described by this shape.
|
void |
reset()
Resets this area to empty.
|
void |
subtract(Area area)
Subtracts the supplied area from this area.
|
String |
toString() |
void |
transform(Transform t)
Transforms this area with the supplied transform.
|
public Area()
public Area(IShape s)
public boolean isPolygonal()
public boolean isRectangular()
public boolean isSingular()
public void reset()
public void transform(Transform t)
public Area createTransformedArea(Transform t)
public void add(Area area)
public void intersect(Area area)
public void subtract(Area area)
public void exclusiveOr(Area area)
public boolean isEmpty()
IShape
public boolean contains(double x, double y)
IShape
public boolean contains(double x, double y, double width, double height)
IShape
public boolean contains(XY p)
IShape
public boolean contains(IRectangle r)
IShape
public boolean intersects(double x, double y, double width, double height)
IShape
intersects
in interface IShape
public boolean intersects(IRectangle r)
IShape
intersects
in interface IShape
public Rectangle bounds()
IShape
public Rectangle bounds(Rectangle target)
IShape
public PathIterator pathIterator(Transform t)
IShape
pathIterator
in interface IShape
t
- if supplied, the points in the path are transformed using this.public PathIterator pathIterator(Transform t, double flatness)
IShape
pathIterator
in interface IShape
t
- if supplied, the points in the path are transformed using this.flatness
- when approximating curved segments with lines, this controls the maximum
distance the lines are allowed to deviate from the approximated curve, thus a higher
flatness value generally allows for a path with fewer segments.Copyright © 2017. All rights reserved.