Class Ellipse

  • All Implemented Interfaces:
    Shape

    @API(type=EXTENDABLE,
         src=PRIVATE)
    public class Ellipse
    extends BaseShape
    The class describes an ellipse that is defined by a bounding rectangle.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int height
      The overall height of this ellipse.
      int width
      The overall width of this ellipse.
      int x
      The x coordinate of the upper left corner of this ellipse.
      int y
      The y coordinate of the upper left corner of thise llipse.
    • Constructor Summary

      Constructors 
      Constructor Description
      Ellipse​(int x, int y, int width, int height)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(int x, int y)
      Warning ! This was not implemented !
      Rectangle getBounds()  
      java.lang.String toString()  
      Shape translate​(int tx, int ty)
      Translate the shape into another one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • x

        public final int x
        The x coordinate of the upper left corner of this ellipse.
      • y

        public final int y
        The y coordinate of the upper left corner of thise llipse.
      • width

        public final int width
        The overall width of this ellipse.
      • height

        public final int height
        The overall height of this ellipse.
    • Constructor Detail

      • Ellipse

        public Ellipse​(int x,
                       int y,
                       int width,
                       int height)
        Constructor.
        Parameters:
        x - The bounding rectangle x pos.
        y - The bounding rectangle y pos.
        width - The bounding rectangle width.
        height - The bounding rectangle height.
    • Method Detail

      • contains

        public boolean contains​(int x,
                                int y)
        Warning ! This was not implemented !
        Parameters:
        x - The horizontal coordinate.
        y - The vertical coordinate.
        Returns:
        true if the point is inside the shape. false otherwise.
        See Also:
        Shape.contains(int, int)
      • translate

        public Shape translate​(int tx,
                               int ty)
        Description copied from interface: Shape
        Translate the shape into another one.
        Parameters:
        tx - the distance by which coordinates are translated in the X axis direction
        ty - the distance by which coordinates are translated in the Y axis direction
        Returns:
        The newly translated shape
        See Also:
        Shape.translate(int, int)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()