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 {@code Shape.intersects()} method allows a {@code Shape}implementation to conservatively return {@code 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 {@code Shapes} this method mightreturn {@code true} even though the rectangular area does notintersect the {@code Shape}. The {@link java.awt.geom.Area Area} class performsmore accurate computations of geometric intersection than most {@code Shape} objects and therefore can be used if a more preciseanswer is required.
@param x the X coordinate of the upper-left cornerof the specified rectangular area
@param y the Y coordinate of the upper-left cornerof the specified rectangular area
@param w the width of the specified rectangular area
@param h the height of the specified rectangular area
@return
true
if the interior of the
Shape
andthe interior of the rectangular area intersect, or are both highly likely to intersect and intersection calculations would be too expensive to perform;
false
otherwise.
@see java.awt.geom.Area
@since 1.2