java.awt.geom

Class Ellipse2D.Double

public static class Ellipse2D.Double extends Ellipse2D

An {@link Ellipse2D} that stores its coordinates using double primitives.
Field Summary
doubleheight
The height of the ellipse.
doublewidth
The width of the ellipse.
doublex
The upper-left x coordinate of the bounding-box
doubley
The upper-left y coordinate of the bounding-box
Constructor Summary
Double()
Creates a new Ellipse2D with an upper-left coordinate of (0,0) and a zero size.
Double(double x, double y, double w, double h)
Creates a new Ellipse2D within a given rectangle using double-precision coordinates.

Method Summary
Rectangle2DgetBounds2D()
Returns the bounding-box of the ellipse.
doublegetHeight()
Returns the height of the ellipse.
doublegetWidth()
Returns the width of the ellipse.
doublegetX()
Returns x coordinate of the upper-left corner of the ellipse's bounding-box.
doublegetY()
Returns y coordinate of the upper-left corner of the ellipse's bounding-box.
booleanisEmpty()
Returns true if the ellipse encloses no area, and false otherwise.
voidsetFrame(double x, double y, double w, double h)
Sets the geometry of the ellipse's bounding box.

Field Detail

height

public double height
The height of the ellipse.

width

public double width
The width of the ellipse.

x

public double x
The upper-left x coordinate of the bounding-box

y

public double y
The upper-left y coordinate of the bounding-box

Constructor Detail

Double

public Double()
Creates a new Ellipse2D with an upper-left coordinate of (0,0) and a zero size.

Double

public Double(double x, double y, double w, double h)
Creates a new Ellipse2D within a given rectangle using double-precision coordinates.

Parameters: x - x coordinate of the upper-left of the bounding rectangle y - y coordinate of the upper-left of the bounding rectangle w - width of the ellipse h - height of the ellipse

Method Detail

getBounds2D

public Rectangle2D getBounds2D()
Returns the bounding-box of the ellipse.

Returns: The bounding box.

getHeight

public double getHeight()
Returns the height of the ellipse.

Returns: The height of the ellipse.

getWidth

public double getWidth()
Returns the width of the ellipse.

Returns: The width of the ellipse.

getX

public double getX()
Returns x coordinate of the upper-left corner of the ellipse's bounding-box.

Returns: The x coordinate.

getY

public double getY()
Returns y coordinate of the upper-left corner of the ellipse's bounding-box.

Returns: The y coordinate.

isEmpty

public boolean isEmpty()
Returns true if the ellipse encloses no area, and false otherwise.

Returns: A boolean.

setFrame

public void setFrame(double x, double y, double w, double h)
Sets the geometry of the ellipse's bounding box.

Parameters: x - x coordinate of the upper-left of the bounding rectangle y - y coordinate of the upper-left of the bounding rectangle w - width of the ellipse h - height of the ellipse