Tests if the interior of the
Shape
intersects the
interior of a specified rectangular area.
The rectangular area is considered to intersect the
Shape
if any point is contained in both the interior of the
Shape
and the specified rectangular area.
The Shape.intersects()
method allows a Shape
implementation to conservatively return true
when:
-
there is a high probability that the rectangular area and the
Shape
intersect, but
-
the calculations to accurately determine this intersection
are prohibitively expensive.
This means that for some
Shapes
this method might
return
true
even though the rectangular area does not
intersect the
Shape
.
The
Area
class performs
more accurate computations of geometric intersection than most
Shape
objects and therefore can be used if a more precise
answer is required.
Returns:
true
if the interior of the
Shape
and
the interior of the rectangular area intersect, or are
both highly likely to intersect and intersection calculations
would be too expensive to perform;
false
otherwise.
Parameters:
-
x - the X coordinate of the upper-left corner
of the specified rectangular area
-
y - the Y coordinate of the upper-left corner
of the specified rectangular area
-
w - the width of the specified rectangular area
-
h - the height of the specified rectangular area
Since:
1.2
See Also:
Area
,