Class Ellipse

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Shape>

    public class Ellipse
    extends AbstractEllipse
    Defines an ellipse.

    WARNING: this API is experimental and will likely change in the near future.

    See Also:
    Serialized Form
    • Constructor Detail

      • Ellipse

        public Ellipse()
      • Ellipse

        public Ellipse​(Point center,
                       double radiusA,
                       double radiusB)
        Construct an ellipse.
        Parameters:
        center - center point of ellipse.
        radiusA - the radius on the semimajor axis
        radiusB - the radius on the semiminor axis
      • Ellipse

        public Ellipse​(Point center,
                       double radiusA,
                       double radiusB,
                       double rotationAngle)
        Construct an ellipse.
        Parameters:
        center - center point of ellipse.
        radiusA - the radius on the semimajor axis
        radiusB - the radius on the semiminor axis
        rotationAngle - the rotation angle of the ellipse around the center point (in radians)
      • Ellipse

        public Ellipse​(double centerX,
                       double centerY,
                       double radiusA,
                       double radiusB,
                       double rotationAngle)
        Construct an ellipse.
        Parameters:
        centerX - x coordinate for center of ellipse.
        centerY - y coordinate for center of ellipse.
        radiusA - the radius on the semimajor axis
        radiusB - the radius on the semiminor axis
        rotationAngle - the rotation angle of the ellipse around the center point (in radians)
    • Method Detail

      • getTypeName

        public java.lang.String getTypeName()
        Specified by:
        getTypeName in class Shape
      • getRotationAngle

        public double getRotationAngle()
        Get the rotation angle for this ellipse (in radians).
        Overrides:
        getRotationAngle in class AbstractEllipse
      • setRotationAngle

        public void setRotationAngle​(double value)
      • getRadiusA

        public double getRadiusA()
        Get the first radius for the ellipse.

        This is the radius along the X plane.

        Specified by:
        getRadiusA in class AbstractEllipse
      • setRadiusA

        public void setRadiusA​(double value)
      • getRadiusB

        public double getRadiusB()
        Get the second for the ellipse.

        This is the radius along the Y plane.

        Specified by:
        getRadiusB in class AbstractEllipse
      • setRadiusB

        public void setRadiusB​(double value)
      • contains

        public boolean contains​(double x,
                                double y)
        Return true if this shape contains the point defined by (x, y).
        Specified by:
        contains in class Shape
      • fastIntersects

        public boolean fastIntersects​(Rectangle other)
        Check if this shape's bounding box intersects with box.
        Specified by:
        fastIntersects in class Shape
      • getBoundingBox

        public Rectangle getBoundingBox()
        Get the rectangle that represents the bounding box that fully contains this shape.
        Specified by:
        getBoundingBox in class Shape
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Shape
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • addArguments

        public void addArguments​(java.lang.StringBuilder buffer)
        Specified by:
        addArguments in class Shape
      • readExternal

        public Ellipse readExternal​(java.io.DataInput in)
                             throws java.io.IOException
        Specified by:
        readExternal in class Shape
        Throws:
        java.io.IOException
      • writeExternal

        public void writeExternal​(java.io.DataOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in class Shape
        Throws:
        java.io.IOException