APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.javafx.geom

public Class Ellipse2D

extends RectangularShape
Class Inheritance
Imports
com.sun.javafx.geom.transform.BaseTransform

The Ellipse2D class describes an ellipse that is defined by a framing rectangle.
Version
1.26, 05/05/07

Field Summary

Modifier and TypeField and Description
public float
height

The overall height of this Ellipse2D.

public float
width

The overall width of this Ellipse2D.

public float
x

The X coordinate of the upper-left corner of the framing rectangle of this Ellipse2D.

public float
y

The Y coordinate of the upper-left corner of the framing rectangle of this Ellipse2D.

Constructor Summary

AccessConstructor and Description
public
Ellipse2D()

Constructs a new Ellipse2D, initialized to location (0, 0) and size (0, 0).

public
Ellipse2D(float
the X coordinate of the upper-left corner of the framing rectangle
x
,
float
the Y coordinate of the upper-left corner of the framing rectangle
y
,
float
the width of the framing rectangle
w
,
float
the height of the framing rectangle
h
)

Constructs and initializes an Ellipse2D from the specified coordinates.

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(float x, float y)

Implements abstract com.sun.javafx.geom.Shape.contains.

Tests if the specified coordinates are inside the boundary of the Shape.

public boolean
contains(float x, float y, float w, float h)

Implements abstract com.sun.javafx.geom.Shape.contains.

Tests if the interior of the Shape entirely contains the specified rectangular area.

public Ellipse2D
copy()

Implements abstract com.sun.javafx.geom.Shape.copy.

Returns a new copy of this Shape instance.

public boolean

Returns:

true if obj is an instance of Ellipse2D and has the same values; false otherwise.
equals
(Object
an Object to be compared with this Ellipse2D.
obj
)

Overrides java.lang.Object.equals.

Determines whether or not the specified Object is equal to this Ellipse2D.

public RectBounds
getBounds()

Overrides com.sun.javafx.geom.RectangularShape.getBounds.

Note that there is no guarantee that the returned RectBounds is the smallest bounding box that encloses the Shape, only that the Shape lies entirely within the indicated RectBounds.

public float
getHeight()

Implements abstract com.sun.javafx.geom.RectangularShape.getHeight.

Returns the height of the framing rectangle in double precision.

public PathIterator

Returns:

the PathIterator object that returns the geometry of the outline of this Ellipse2D, one segment at a time.
getPathIterator
(BaseTransform
an optional BaseTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired
tx
)

Implements abstract com.sun.javafx.geom.Shape.getPathIterator.

Returns an iteration object that defines the boundary of this Ellipse2D.

public float
getWidth()

Implements abstract com.sun.javafx.geom.RectangularShape.getWidth.

Returns the width of the framing rectangle in double precision.

public float
getX()

Implements abstract com.sun.javafx.geom.RectangularShape.getX.

Returns the X coordinate of the upper-left corner of the framing rectangle in double precision.

public float
getY()

Implements abstract com.sun.javafx.geom.RectangularShape.getY.

Returns the Y coordinate of the upper-left corner of the framing rectangle in double precision.

public int

Returns:

the hashcode for this Ellipse2D.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hashcode for this Ellipse2D.

public boolean
intersects(float x, float y, float w, float h)

Implements abstract com.sun.javafx.geom.Shape.intersects.

Tests if the interior of the Shape intersects the interior of a specified rectangular area.

public boolean
isEmpty()

Implements abstract com.sun.javafx.geom.RectangularShape.isEmpty.

Determines whether the RectangularShape is empty.

public void
setFrame(float
the X coordinate of the upper-left corner of the specified rectangular shape
x
,
float
the Y coordinate of the upper-left corner of the specified rectangular shape
y
,
float
the width of the specified rectangular shape
w
,
float
the height of the specified rectangular shape
h
)

Implements abstract com.sun.javafx.geom.RectangularShape.setFrame.

Sets the location and size of the framing rectangle of this Shape to the specified rectangular values.

Inherited from com.sun.javafx.geom.RectangularShape:
containsgetCenterXgetCenterYgetMaxXgetMaxYgetMinXgetMinYgetPathIteratorsetFramesetFrameFromCentersetFrameFromCentersetFrameFromDiagonalsetFrameFromDiagonaltoString

Field Detail

heightback to summary
public float height

The overall height of this Ellipse2D.

widthback to summary
public float width

The overall width of this Ellipse2D.

xback to summary
public float x

The X coordinate of the upper-left corner of the framing rectangle of this Ellipse2D.

yback to summary
public float y

The Y coordinate of the upper-left corner of the framing rectangle of this Ellipse2D.

Constructor Detail

Ellipse2Dback to summary
public Ellipse2D()

Constructs a new Ellipse2D, initialized to location (0, 0) and size (0, 0).

Ellipse2Dback to summary
public Ellipse2D(float x, float y, float w, float h)

Constructs and initializes an Ellipse2D from the specified coordinates.

Parameters
x:float

the X coordinate of the upper-left corner of the framing rectangle

y:float

the Y coordinate of the upper-left corner of the framing rectangle

w:float

the width of the framing rectangle

h:float

the height of the framing rectangle

Method Detail

containsback to summary
public boolean contains(float x, float y)

Implements abstract com.sun.javafx.geom.Shape.contains.

Doc from com.sun.javafx.geom.Shape.contains.

Tests if the specified coordinates are inside the boundary of the Shape.

Annotations
@Override
containsback to summary
public boolean contains(float x, float y, float w, float h)

Implements abstract com.sun.javafx.geom.Shape.contains.

Doc from com.sun.javafx.geom.Shape.contains.

Tests if the interior of the Shape entirely contains the specified rectangular area. All coordinates that lie inside the rectangular area must lie within the Shape for the entire rectanglar area to be considered contained within the Shape.

The Shape.contains() method allows a Shape implementation to conservatively return false when:

  • the intersect method returns true and
  • the calculations to determine whether or not the Shape entirely contains the rectangular area are prohibitively expensive.
This means that for some Shapes this method might return false even though the Shape contains the rectangular area. The Area class performs more accurate geometric computations than most Shape objects and therefore can be used if a more precise answer is required.
Annotations
@Override
copyback to summary
public Ellipse2D copy()

Implements abstract com.sun.javafx.geom.Shape.copy.

Doc from com.sun.javafx.geom.Shape.copy.

Returns a new copy of this Shape instance.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Determines whether or not the specified Object is equal to this Ellipse2D. The specified Object is equal to this Ellipse2D if it is an instance of Ellipse2D and if its location and size are the same as this Ellipse2D.

Parameters
obj:Object

an Object to be compared with this Ellipse2D.

Returns:boolean

true if obj is an instance of Ellipse2D and has the same values; false otherwise.

Annotations
@Override
getBoundsback to summary
public RectBounds getBounds()

Overrides com.sun.javafx.geom.RectangularShape.getBounds.

Doc from com.sun.javafx.geom.RectangularShape.getBounds.

Note that there is no guarantee that the returned RectBounds is the smallest bounding box that encloses the Shape, only that the Shape lies entirely within the indicated RectBounds.

Annotations
@Override
getHeightback to summary
public float getHeight()

Implements abstract com.sun.javafx.geom.RectangularShape.getHeight.

Doc from com.sun.javafx.geom.RectangularShape.getHeight.

Returns the height of the framing rectangle in double precision.

Annotations
@Override
getPathIteratorback to summary
public PathIterator getPathIterator(BaseTransform tx)

Implements abstract com.sun.javafx.geom.Shape.getPathIterator.

Returns an iteration object that defines the boundary of this Ellipse2D. The iterator for this class is multi-threaded safe, which means that this Ellipse2D class guarantees that modifications to the geometry of this Ellipse2D object do not affect any iterations of that geometry that are already in process.

Parameters
tx:BaseTransform

an optional BaseTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired

Returns:PathIterator

the PathIterator object that returns the geometry of the outline of this Ellipse2D, one segment at a time.

Annotations
@Override
getWidthback to summary
public float getWidth()

Implements abstract com.sun.javafx.geom.RectangularShape.getWidth.

Doc from com.sun.javafx.geom.RectangularShape.getWidth.

Returns the width of the framing rectangle in double precision.

Annotations
@Override
getXback to summary
public float getX()

Implements abstract com.sun.javafx.geom.RectangularShape.getX.

Doc from com.sun.javafx.geom.RectangularShape.getX.

Returns the X coordinate of the upper-left corner of the framing rectangle in double precision.

Annotations
@Override
getYback to summary
public float getY()

Implements abstract com.sun.javafx.geom.RectangularShape.getY.

Doc from com.sun.javafx.geom.RectangularShape.getY.

Returns the Y coordinate of the upper-left corner of the framing rectangle in double precision.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hashcode for this Ellipse2D.

Returns:int

the hashcode for this Ellipse2D.

Annotations
@Override
intersectsback to summary
public boolean intersects(float x, float y, float w, float h)

Implements abstract com.sun.javafx.geom.Shape.intersects.

Doc from com.sun.javafx.geom.Shape.intersects.

Tests if the interior of the Shape intersects the interior of a specified rectangular area. The rectangular area is considered to intersect the Shape if any point is contained in both the interior of the Shape and the specified rectangular area.

The Shape.intersects() method allows a Shape implementation to conservatively return true when:

  • there is a high probability that the rectangular area and the Shape intersect, but
  • the calculations to accurately determine this intersection are prohibitively expensive.
This means that for some Shapes this method might return true even though the rectangular area does not intersect the Shape. The Area class performs more accurate computations of geometric intersection than most Shape objects and therefore can be used if a more precise answer is required.
Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements abstract com.sun.javafx.geom.RectangularShape.isEmpty.

Doc from com.sun.javafx.geom.RectangularShape.isEmpty.

Determines whether the RectangularShape is empty. When the RectangularShape is empty, it encloses no area.

Annotations
@Override
setFrameback to summary
public void setFrame(float x, float y, float w, float h)

Implements abstract com.sun.javafx.geom.RectangularShape.setFrame.

Sets the location and size of the framing rectangle of this Shape to the specified rectangular values.

Parameters
x:float

the X coordinate of the upper-left corner of the specified rectangular shape

y:float

the Y coordinate of the upper-left corner of the specified rectangular shape

w:float

the width of the specified rectangular shape

h:float

the height of the specified rectangular shape

Annotations
@Override