|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.geom.RectangularShape
public abstract class RectangularShape
An abstract base class for shapes based on a rectangular frame.
Constructor Summary | |
---|---|
RectangularShape()
|
Method Summary | |
---|---|
Object |
clone()
Create a copy of this object, using a shallow copy. |
boolean |
contains(Point2D p)
Test if the shape contains a Point2D |
boolean |
contains(Rectangle2D r)
Test if this shape contains a given Rectangle2D |
Rectangle |
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 |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.Shape |
---|
contains, contains, getBounds2D, intersects |
Constructor Detail |
---|
public RectangularShape()
Method Detail |
---|
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)
contains
in interface Shape
p
- the Point2D
public boolean intersects(Rectangle2D r)
intersects
in interface Shape
r
- the Rectangle2D
public boolean contains(Rectangle2D r)
contains
in interface Shape
r
- the Rectangle2D
public Rectangle getBounds()
getBounds
in interface Shape
public Object clone()
Object
clone
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |