java.awt.geom
public abstract class Ellipse2D extends RectangularShape
(x/a)2 + (y/b)2 = 1
Modifier and Type | Class and Description |
---|---|
static class |
Ellipse2D.Double
An
Ellipse2D that stores its coordinates using double
primitives. |
static class |
Ellipse2D.Float
An
Ellipse2D that stores its coordinates using float
primitives. |
Modifier | Constructor and Description |
---|---|
protected |
Ellipse2D()
Ellipse2D is defined as abstract.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x,
double y)
Determines if a point is contained within the ellipse.
|
boolean |
contains(double x,
double y,
double w,
double h)
Determines if a rectangle is completely contained within the
ellipse.
|
PathIterator |
getPathIterator(AffineTransform at)
Returns a PathIterator object corresponding to the ellipse.
|
boolean |
intersects(double x,
double y,
double w,
double h)
Determines if a rectangle intersects any part of the ellipse.
|
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getHeight, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, getWidth, getX, getY, intersects, isEmpty, setFrame, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBounds2D
protected Ellipse2D()
public boolean contains(double x, double y)
x
- - x coordinate of the point.y
- - y coordinate of the point.public boolean contains(double x, double y, double w, double h)
x
- - x coordinate of the upper-left corner of the rectangley
- - y coordinate of the upper-left corner of the rectanglew
- - width of the rectangleh
- - height of the rectangleArea
public PathIterator getPathIterator(AffineTransform at)
Note: An ellipse cannot be represented exactly in PathIterator segments, the outline is thefore approximated with cubic Bezier segments.
at
- an optional transform.public boolean intersects(double x, double y, double w, double h)
x
- - x coordinate of the upper-left corner of the rectangley
- - y coordinate of the upper-left corner of the rectanglew
- - width of the rectangleh
- - height of the rectangleArea