Class RectangleF


  • public class RectangleF
    extends java.lang.Object
    Represents a rectangle with float coordinates in 2D space.
    • Constructor Summary

      Constructors 
      Constructor Description
      RectangleF​(float x, float y, float width, float height)
      Constructs a rectangle with given coordinates and dimensions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getHeight()
      Returns the height of the rectangle.
      float getWidth()
      Returns the width of the rectangle.
      float getX()
      Returns the x-coordinate of the top-left corner of the rectangle.
      float getY()
      Returns the y-coordinate of the top-left corner of the rectangle.
      void setHeight​(float height)
      Sets the height of the rectangle.
      void setWidth​(float width)
      Sets the width of the rectangle.
      void setX​(float x)
      Sets the x-coordinate of the top-left corner of the rectangle.
      void setY​(float y)
      Sets the y-coordinate of the top-left corner of the rectangle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RectangleF

        public RectangleF​(float x,
                          float y,
                          float width,
                          float height)
        Constructs a rectangle with given coordinates and dimensions.
        Parameters:
        x - x-coordinate of the top-left corner
        y - y-coordinate of the top-left corner
        width - width
        height - height
    • Method Detail

      • getX

        public float getX()
        Returns the x-coordinate of the top-left corner of the rectangle.
        Returns:
        x-coordinate
      • setX

        public void setX​(float x)
        Sets the x-coordinate of the top-left corner of the rectangle.
        Parameters:
        x - x-coordinate
      • getY

        public float getY()
        Returns the y-coordinate of the top-left corner of the rectangle.
        Returns:
        y-coordinate
      • setY

        public void setY​(float y)
        Sets the y-coordinate of the top-left corner of the rectangle.
        Parameters:
        y - y-coordinate
      • getWidth

        public float getWidth()
        Returns the width of the rectangle.
        Returns:
        width
      • setWidth

        public void setWidth​(float width)
        Sets the width of the rectangle.
        Parameters:
        width - width
      • getHeight

        public float getHeight()
        Returns the height of the rectangle.
        Returns:
        height
      • setHeight

        public void setHeight​(float height)
        Sets the height of the rectangle.
        Parameters:
        height - height