|
||||||||||
| 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 |
|---|
Rectangle2D.Double, 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 |
| 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(Rectangle2D rect)
Constructor from awt, to allow easy construction from existing apps. |
|
| Method Summary | |
|---|---|
Domain2D |
clip(Box2D box)
Returns the clipping of the rectangle, as an instance of HRectangle2D. |
Polygon2D |
complement()
Returns the complementary polygon. |
void |
draw(Graphics2D g2)
Draw the shape on the given graphics. |
boolean |
equals(Object obj)
Test if rectangles are the same. |
void |
fill(Graphics2D g2)
Fills the interior of the domain, using the Graphics current Paint. |
CirculinearBoundarySet2D<LinearRing2D> |
getBoundary()
Returns the boundary of the set. |
Box2D |
getBoundingBox()
Returns the bounding box of the shape. |
CirculinearDomain2D |
getBuffer(double dist)
Computes the buffer of the shape, formed by the set of points located at a distance from the shape that is lower or equal to d. |
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. |
double |
getDistance(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. |
int |
getEdgeNumber()
Returns the number of edges of the polygon |
Collection<LineSegment2D> |
getEdges()
Return the edges as line segments of the polygon |
Collection<LinearRing2D> |
getRings()
Returns the set of rings comprising the boundary of this polygon. |
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(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. |
Point2D |
getVertex(int i)
Returns the i-th vertex of the polygon. |
int |
getVertexNumber()
Returns the number of vertex, which is 4. |
Collection<Point2D> |
getVertices()
Returns the vertices (singular points) of the polygon |
boolean |
isBounded()
Always returns true, because a rectangle is always bounded. |
SimplePolygon2D |
transform(AffineTransform2D trans)
Return the new Polygon created by an affine transform of this polygon. |
CirculinearDomain2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion. |
| 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 math.geom2d.Shape2D |
|---|
contains, contains, isEmpty |
| Constructor Detail |
|---|
public HRectangle2D(double x0,
double y0,
double w,
double h)
public HRectangle2D()
public HRectangle2D(Rectangle2D rect)
public HRectangle2D(Point2D point,
double w,
double h)
| Method Detail |
|---|
public boolean isBounded()
isBounded in interface Shape2Dpublic Collection<Point2D> getVertices()
Polygon2D
getVertices in interface Polygon2Dpublic Point2D getVertex(int i)
getVertex in interface Polygon2Di - index of the vertex, between 0 and 3public int getVertexNumber()
getVertexNumber in interface Polygon2Dpublic Collection<LineSegment2D> getEdges()
Polygon2D
getEdges in interface Polygon2Dpublic int getEdgeNumber()
Polygon2D
getEdgeNumber in interface Polygon2Dpublic Collection<LinearRing2D> getRings()
Polygon2D
getRings in interface Polygon2Dpublic CirculinearDomain2D transform(CircleInversion2D inv)
CirculinearShape2D
transform in interface CirculinearDomain2Dtransform in interface CirculinearShape2Dinv - the circle inversion
public CirculinearDomain2D getBuffer(double dist)
CirculinearShape2D
getBuffer in interface CirculinearShape2Ddist - the maximal distance between a point of the buffer and the
shape
public CirculinearBoundarySet2D<LinearRing2D> getBoundary()
Domain2DThe returned curve is oriented, with an interior and an exterior.
getBoundary in interface CirculinearDomain2DgetBoundary in interface Domain2DgetBoundary in interface Polygon2Dpublic Polygon2D complement()
Polygon2D
complement in interface Domain2Dcomplement in interface Polygon2Dpublic double getDistance(Point2D p)
Shape2D
getDistance in interface Shape2D
public double getDistance(double x,
double y)
Shape2D
getDistance in interface Shape2Dpublic double getSignedDistance(Point2D p)
public double getSignedDistance(double x,
double y)
public Domain2D clip(Box2D box)
clip in interface Domain2Dclip in interface Shape2Dbox - the clipping box
public void draw(Graphics2D g2)
Shape2D
draw in interface Domain2Ddraw in interface Shape2Dg2 - the Graphics to draw onpublic void fill(Graphics2D g2)
Domain2D
fill in interface Domain2Dg2 - the Graphics to fill onpublic Box2D getBoundingBox()
Shape2D
getBoundingBox in interface Shape2Dpublic boolean equals(Object obj)
equals in class Rectangle2Dpublic SimplePolygon2D transform(AffineTransform2D trans)
transform in interface Domain2Dtransform in interface Polygon2Dtransform in interface Shape2Dtrans - an affine transform
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||