|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.epseelon.mobimap.geom.RectangularShape
org.epseelon.mobimap.geom.Rectangle2D
org.epseelon.mobimap.geom.Rectangle2D.Double
public static class Rectangle2D.Double
This class defines a rectangle in double precision.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.epseelon.mobimap.geom.Rectangle2D |
|---|
Rectangle2D.Double, Rectangle2D.Float |
| Field Summary | |
|---|---|
double |
height
The height of the rectangle. |
double |
width
The width of the rectangle. |
double |
x
The x coordinate of the lower left corner. |
double |
y
The y coordinate of the lower left corner. |
| Fields inherited from class org.epseelon.mobimap.geom.Rectangle2D |
|---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
| Constructor Summary | |
|---|---|
Rectangle2D.Double()
Create a rectangle at (0,0) with width 0 and height 0. |
|
Rectangle2D.Double(double x,
double y,
double w,
double h)
Create a rectangle with the given values. |
|
| Method Summary | |
|---|---|
Rectangle2D |
createIntersection(Rectangle2D r)
Return a new rectangle which is the intersection of this and the given one. |
Rectangle2D |
createUnion(Rectangle2D r)
Return a new rectangle which is the union of this and the given one. |
Rectangle2D |
getBounds2D()
Returns the bounds of this rectangle. |
double |
getHeight()
Return the height. |
double |
getWidth()
Return the width. |
double |
getX()
Return the X coordinate. |
double |
getY()
Return the Y coordinate. |
boolean |
isEmpty()
Test if the rectangle is empty. |
int |
outcode(double x,
double y)
Determine where the point lies with respect to this rectangle. |
void |
setRect(double x,
double y,
double w,
double h)
Set the contents of this rectangle to those specified. |
void |
setRect(Rectangle2D r)
Set the contents of this rectangle to those specified. |
java.lang.String |
toString()
Returns a string representation of this rectangle. |
| Methods inherited from class org.epseelon.mobimap.geom.Rectangle2D |
|---|
add, add, add, contains, contains, equals, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union |
| Methods inherited from class org.epseelon.mobimap.geom.RectangularShape |
|---|
contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double x
public double y
public double width
public double height
| Constructor Detail |
|---|
public Rectangle2D.Double()
public Rectangle2D.Double(double x,
double y,
double w,
double h)
x - the x coordinatey - the y coordinatew - the widthh - the height| Method Detail |
|---|
public double getX()
getX in class RectangularShapepublic double getY()
getY in class RectangularShapepublic double getWidth()
getWidth in class RectangularShapepublic double getHeight()
getHeight in class RectangularShapepublic boolean isEmpty()
isEmpty in class RectangularShape
public void setRect(double x,
double y,
double w,
double h)
setRect in class Rectangle2Dx - the x coordinatey - the y coordinatew - the widthh - the heightpublic void setRect(Rectangle2D r)
setRect in class Rectangle2Dr - the rectangle to copy
java.lang.NullPointerException - if r is null
public int outcode(double x,
double y)
outcode in class Rectangle2Dx - the x coordinate to checky - the y coordinate to check
Rectangle2D.OUT_LEFT,
Rectangle2D.OUT_TOP,
Rectangle2D.OUT_RIGHT,
Rectangle2D.OUT_BOTTOMpublic Rectangle2D getBounds2D()
Shape.getBounds()public Rectangle2D createIntersection(Rectangle2D r)
createIntersection in class Rectangle2Dr - the rectangle to be intersected
java.lang.NullPointerException - if r is nullpublic Rectangle2D createUnion(Rectangle2D r)
createUnion in class Rectangle2Dr - the rectangle to be merged
java.lang.NullPointerException - if r is nullpublic java.lang.String toString()
getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width
+ ",h=" + height + ']'.
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||