|
|||||||||
| Home >> All >> java >> awt >> [ geom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.awt.geom
Class Rectangle2D.Double

java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double
- All Implemented Interfaces:
- java.lang.Cloneable, java.awt.Shape
- Enclosing class:
- Rectangle2D
- public static class Rectangle2D.Double
- extends Rectangle2D
This class defines a rectangle in double precision.
- Since:
- 1.2
| Nested Class Summary |
| Nested classes inherited from class java.awt.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 java.awt.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 java.awt.geom.Rectangle2D |
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union |
| Methods inherited from class java.awt.geom.RectangularShape |
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
x
public double x
- The x coordinate of the lower left corner.
y
public double y
- The y coordinate of the lower left corner.
width
public double width
- The width of the rectangle.
height
public double height
- The height of the rectangle.
| Constructor Detail |
Rectangle2D.Double
public Rectangle2D.Double()
- Create a rectangle at (0,0) with width 0 and height 0.
Rectangle2D.Double
public Rectangle2D.Double(double x,
double y,
double w,
double h)
- Create a rectangle with the given values.
| Method Detail |
getX
public double getX()
- Return the X coordinate.
- Specified by:
getXin classRectangularShape
getY
public double getY()
- Return the Y coordinate.
- Specified by:
getYin classRectangularShape
getWidth
public double getWidth()
- Return the width.
- Specified by:
getWidthin classRectangularShape
getHeight
public double getHeight()
- Return the height.
- Specified by:
getHeightin classRectangularShape
isEmpty
public boolean isEmpty()
- Test if the rectangle is empty.
- Specified by:
isEmptyin classRectangularShape
setRect
public void setRect(double x,
double y,
double w,
double h)
- Set the contents of this rectangle to those specified.
- Specified by:
setRectin classRectangle2D
setRect
public void setRect(Rectangle2D r)
- Set the contents of this rectangle to those specified.
- Overrides:
setRectin classRectangle2D
outcode
public int outcode(double x,
double y)
- Determine where the point lies with respect to this rectangle. The
result will be the binary OR of the appropriate bit masks.
- Specified by:
outcodein classRectangle2D
- Since:
- 1.2
getBounds2D
public Rectangle2D getBounds2D()
- Returns the bounds of this rectangle. A pretty useless method, as this
is already a rectangle.
- Specified by:
getBounds2Din interfacejava.awt.Shape- Overrides:
getBounds2Din classRectangle2D
createIntersection
public Rectangle2D createIntersection(Rectangle2D r)
- Return a new rectangle which is the intersection of this and the given
one. The result will be empty if there is no intersection.
- Specified by:
createIntersectionin classRectangle2D
createUnion
public Rectangle2D createUnion(Rectangle2D r)
- Return a new rectangle which is the union of this and the given one.
- Specified by:
createUnionin classRectangle2D
toString
public java.lang.String toString()
- Returns a string representation of this rectangle. This is in the form
getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width + ",h=" + height + ']'.
|
|||||||||
| Home >> All >> java >> awt >> [ geom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC