public abstract class RectangularShape extends java.lang.Object implements Shape, java.lang.Cloneable
Constructor and Description |
---|
RectangularShape() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
contains(Point2D p)
Test if the shape contains a Point2D
|
boolean |
contains(Rectangle2D r)
Test if this shape contains a given Rectangle2D
|
RectangleInt32 |
getBounds()
Get the bounds of this rectangular shape as a Rectangle
|
double |
getCenterX()
Get the x coordinate of the center of the shape
|
double |
getCenterY()
Get the y coordinate of the center of the shape
|
Rectangle2D |
getFrame()
Get the framing rectangle
|
abstract double |
getHeight()
Get the height as a double
|
double |
getMaxX()
Get the maximum value of the x coordinate
|
double |
getMaxY()
Get the maximum value of the y coordinate
|
double |
getMinX()
Get the minimum value of the x x coordinate
|
double |
getMinY()
Get the minimum value of the y coordinate
|
abstract double |
getWidth()
Get the width as a double
|
abstract double |
getX()
Get the x coordinate as a double
|
abstract double |
getY()
Get the y coordinate as a double
|
boolean |
intersects(Rectangle2D r)
Test if this shape intersects a given Rectangle2D
|
abstract boolean |
isEmpty()
Test if the rectangular shape is empty
|
abstract void |
setFrame(double x,
double y,
double w,
double h)
Set the frame for the rectangular shape
|
void |
setFrame(Rectangle2D r)
Set the frame of the rectangular shape
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, contains, getBounds2D, intersects
public abstract double getX()
public abstract double getY()
public abstract double getWidth()
public abstract double getHeight()
public double getMinX()
public double getMinY()
public double getMaxX()
public double getMaxY()
public double getCenterX()
public double getCenterY()
public Rectangle2D getFrame()
public abstract boolean isEmpty()
public abstract void setFrame(double x, double y, double w, double h)
x
- the x coordinate of the top left cornery
- the y coordinate iof the top left cornerw
- the widthh
- the heightpublic void setFrame(Rectangle2D r)
r
- the framing rectanglepublic boolean contains(Point2D p)
public boolean intersects(Rectangle2D r)
intersects
in interface Shape
r
- the Rectangle2Dpublic boolean contains(Rectangle2D r)
public RectangleInt32 getBounds()
public java.lang.Object clone()
clone
in class java.lang.Object