public static class Rectangle2D.Double extends Rectangle2D
Rectangle2D.Double, Rectangle2D.Float| Modifier and Type | Field and Description |
|---|---|
double |
height
The height of the rectangle;
|
double |
width
The width of the rectangle
|
double |
x
The x coordinate of the top left corner
|
double |
y
The y coordinate of the top right corner
|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP| Constructor and Description |
|---|
Double()
Create an empty rectangle at (0,0)
|
Double(double x,
double y,
double width,
double height) |
| Modifier and Type | Method and Description |
|---|---|
Rectangle2D |
getBounds2D()
Get the bounding Rectangle2D for the shape
|
double |
getHeight()
Get the height as a double
|
double |
getWidth()
Get the width as a double
|
double |
getX()
Get the x coordinate as a double
|
double |
getY()
Get the y coordinate as a double
|
boolean |
isEmpty()
Test if the rectangular shape is empty
|
int |
outcode(double x,
double y)
Returns a mask value that specifies where a point lies with respect
to this rectangle.
|
void |
setFrame(double x,
double y,
double w,
double h)
Set the frame for the rectangular shape
|
void |
setRect(double x,
double y,
double w,
double h)
Set this rectangle to a rectangle defined by double coordinates
|
void |
setRect(Rectangle2D r)
Set this Rectangle2D to be the same as a given Rectangle2D
|
contains, contains, equals, intersects, intersectsLine, outcodeclone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFramepublic double x
public double y
public double width
public double height
public Double()
public Double(double x,
double y,
double width,
double height)
public double getX()
RectangularShapegetX in class RectangularShapepublic double getY()
RectangularShapegetY in class RectangularShapepublic double getWidth()
RectangularShapegetWidth in class RectangularShapepublic double getHeight()
RectangularShapegetHeight in class RectangularShapepublic boolean isEmpty()
RectangularShapeisEmpty in class RectangularShapepublic void setFrame(double x,
double y,
double w,
double h)
RectangularShapesetFrame in class Rectangle2Dx - the x coordinate of the top left cornery - the y coordinate iof the top left cornerw - the widthh - the heightpublic Rectangle2D getBounds2D()
Shapepublic void setRect(double x,
double y,
double w,
double h)
Rectangle2DsetRect in class Rectangle2Dx - the x coordinate of the top left cornery - the y coordinate of the top right cornerw - the width of the rectangleh - the height of the rectanglepublic void setRect(Rectangle2D r)
Rectangle2DsetRect in class Rectangle2Dr - the Rectangle2Dpublic int outcode(double x,
double y)
Rectangle2Doutcode in class Rectangle2Dx - the x coordinate of the given pointy - the y coordinate of the given point