Returns a new Rectangle2D object representing the
intersection of this Rectangle2D with the specified
Rectangle2D.
r | the Rectangle2D to be intersected with
this Rectangle2D |
Rectangle2D contained in both
the specified Rectangle2D and in this
Rectangle2D.
Returns a new Rectangle2D object representing the
union of this Rectangle2D with the specified
Rectangle2D.
r | the Rectangle2D to be combined with
this Rectangle2D |
Rectangle2D containing both
the specified Rectangle2D and this
Rectangle2D.
Returns a high precision and more accurate bounding box of
the Shape than the getBounds method.
Note that there is no guarantee that the returned
Rectangle2D is the smallest bounding box that encloses
the Shape, only that the Shape lies
entirely within the indicated Rectangle2D. The
bounding box returned by this method is usually tighter than that
returned by the getBounds method and never fails due
to overflow problems since the return value can be an instance of
the Rectangle2D that uses double precision values to
store the dimensions.
Note that the
definition of insideness can lead to situations where points
on the defining outline of the shape may not be considered
contained in the returned bounds object, but only in cases
where those points are also not considered contained in the original
shape.
If a point is inside the shape according to the
contains(point) method, then it must
be inside the returned Rectangle2D bounds object according
to the contains(point) method of the
bounds. Specifically:
shape.contains(p) requires bounds.contains(p)
If a point is not inside the shape, then it might
still be contained in the bounds object:
bounds.contains(p) does not imply shape.contains(p)
Rectangle2D that is a
high-precision bounding box of the Shape.
Returns the height of the bounding Rectangle in
double precision.
Rectangle.
Returns the width of the bounding Rectangle in
double precision.
Rectangle.
Returns the X coordinate of the bounding Rectangle in
double precision.
Rectangle.
Returns the Y coordinate of the bounding Rectangle in
double precision.
Rectangle.
Determines whether the RectangularShape is empty.
When the RectangularShape is empty, it encloses no
area.
true if the RectangularShape is empty;
false otherwise.
Determines where the specified coordinates lie with respect
to this Rectangle2D.
This method computes a binary OR of the appropriate mask values
indicating, for each side of this Rectangle2D,
whether or not the specified coordinates are on the same side
of the edge as the rest of this Rectangle2D.
x | the specified X coordinate | |
y | the specified Y coordinate |
Sets the bounds of this Rectangle to the integer bounds
which encompass the specified x, y, width,
and height.
If the parameters specify a Rectangle that exceeds the
maximum range of integers, the result will be the best
representation of the specified Rectangle intersected
with the maximum integer bounds.
x | the X coordinate of the upper-left corner of the specified rectangle | |
y | the Y coordinate of the upper-left corner of the specified rectangle | |
width | the width of the specified rectangle | |
height | the new height of the specified rectangle |
Diagram: Rectangular Shapes