|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double
math.geom2d.polygon.HRectangle2D
public class HRectangle2D
HRectangle2D defines a rectangle with edges parallel to main axis. Thus,
it can not be rotated, contrary to Rectangle2D. This class is actually
simply a wrapper of class java.awt.geom.Rectangle2D.Double
with interface AbstractPolygon.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
|---|
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
| Field Summary |
|---|
| Fields inherited from class java.awt.geom.Rectangle2D.Double |
|---|
height, width, x, y |
| Fields inherited from class java.awt.geom.Rectangle2D |
|---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY, defaultClipWindow, EMPTY_SET |
| Constructor Summary | |
|---|---|
HRectangle2D()
Empty constructor (size and position zero) |
|
HRectangle2D(double x0,
double y0,
double w,
double h)
Main constructor |
|
HRectangle2D(Point2D point,
double w,
double h)
Main constructor |
|
HRectangle2D(java.awt.geom.Rectangle2D rect)
Constructor from awt, to allow easy construction from existing apps. |
|
| Method Summary | |
|---|---|
Shape2D |
clip(Box2D box)
Returns the clipping of the rectangle, as an instance of HRectangle2D. |
boolean |
containsBounds(Shape2D shape)
Test if the specified Shape is totally contained in this Rectangle. |
boolean |
equals(java.lang.Object obj)
Test if rectangles are the same. |
Boundary2D |
getBoundary()
returns the boundary of the set. |
Box2D |
getBoundingBox()
Returns the bounding box of the shape. |
Shape2D |
getClippedShape(Box2D box)
return the clipping of the rectangle, as an instance of HRectangle2D. |
double |
getDistance(double x,
double y)
get the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e. fillable) shape. |
double |
getDistance(java.awt.geom.Point2D p)
get the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape. |
java.util.Collection<LineSegment2D> |
getEdges()
Return the edges as line segments of the polygon |
java.util.Iterator<Point2D> |
getPoints()
Deprecated. use getVertices() instead. |
double |
getSignedDistance(double x,
double y)
Get the signed distance of the shape to the given point : this distance is positive if the point lies outside the shape, and is negative if the point lies inside the shape. |
double |
getSignedDistance(java.awt.geom.Point2D p)
Get the signed distance of the shape to the given point : this distance is positive if the point lies outside the shape, and is negative if the point lies inside the shape. |
java.util.Collection<Point2D> |
getVertices()
Return the vertices (singular points) of the polygon |
int |
getVerticesNumber()
Return the number of vertices of the polygon |
boolean |
isBounded()
Always returns true, because a rectangle is always bounded. |
Polygon2D |
transform(AffineTransform2D trans)
Return the new Polygon created by an affine transform of this polygon. |
| Methods inherited from class java.awt.geom.Rectangle2D.Double |
|---|
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect, toString |
| Methods inherited from class java.awt.geom.Rectangle2D |
|---|
add, add, add, contains, contains, 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 |
| Methods inherited from interface java.awt.Shape |
|---|
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects |
| Constructor Detail |
|---|
public HRectangle2D(double x0,
double y0,
double w,
double h)
public HRectangle2D()
public HRectangle2D(java.awt.geom.Rectangle2D rect)
public HRectangle2D(Point2D point,
double w,
double h)
| Method Detail |
|---|
public boolean isBounded()
isBounded in interface Shape2Dpublic boolean containsBounds(Shape2D shape)
@Deprecated public java.util.Iterator<Point2D> getPoints()
public java.util.Collection<Point2D> getVertices()
PolygonalShape2D
getVertices in interface PolygonalShape2Dpublic int getVerticesNumber()
PolygonalShape2D
getVerticesNumber in interface PolygonalShape2Dpublic java.util.Collection<LineSegment2D> getEdges()
PolygonalShape2D
getEdges in interface PolygonalShape2Dpublic Boundary2D getBoundary()
Domain2DThe returned curve is oriented, with an interior and an exterior.
getBoundary in interface Domain2Dpublic double getDistance(java.awt.geom.Point2D p)
Shape2D
getDistance in interface Shape2D
public double getDistance(double x,
double y)
Shape2D
getDistance in interface Shape2Dpublic double getSignedDistance(java.awt.geom.Point2D p)
public double getSignedDistance(double x,
double y)
public Shape2D getClippedShape(Box2D box)
public Shape2D clip(Box2D box)
clip in interface Shape2Dbox - the clipping box
public Box2D getBoundingBox()
Shape2D
getBoundingBox in interface Shape2Dpublic boolean equals(java.lang.Object obj)
equals in class java.awt.geom.Rectangle2Dpublic Polygon2D transform(AffineTransform2D trans)
transform in interface PolygonalShape2Dtransform in interface Shape2Dtrans - an affine transform
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||