Class RectangleWrapper

    • Constructor Detail

      • RectangleWrapper

        public RectangleWrapper​(RectangleData shape)
        Constructor of the RectangleWrapper class using a RectangleData.
        Parameters:
        shape - the shape
      • RectangleWrapper

        public RectangleWrapper()
        Constructor of the RectangleWrapper class using a new empty RectangleData.
      • RectangleWrapper

        public RectangleWrapper​(double x,
                                double y,
                                double width,
                                double height)
        Constructor of the RectangleWrapper class using a new RectangleData.
        Parameters:
        x - The x-coordinate of the top-left corner.
        y - The y-coordinate of the top-left corner.
        width - The width of the rectangle.
        height - The height of the rectangle.
    • Method Detail

      • getX

        public double getX()
        Returns the x-coordinate of the shape.
        Returns:
        See above.
      • setX

        public void setX​(double x)
        Sets the x-coordinate of the shape.
        Parameters:
        x - See above.
      • getY

        public double getY()
        Returns the y coordinate of the shape.
        Returns:
        See above.
      • setY

        public void setY​(double y)
        Sets the y-coordinate of the shape.
        Parameters:
        y - See above.
      • getWidth

        public double getWidth()
        Returns the width untransformed rectangle.
        Returns:
        See above.
      • setWidth

        public void setWidth​(double width)
        Sets width of an untransformed rectangle.
        Parameters:
        width - See above.
      • getHeight

        public double getHeight()
        Returns the height untransformed rectangle.
        Returns:
        See above.
      • setHeight

        public void setHeight​(double height)
        Sets the height of an untransformed rectangle.
        Parameters:
        height - See above.
      • setCoordinates

        public void setCoordinates​(double x,
                                   double y,
                                   double width,
                                   double height)
        Sets the coordinates of the RectangleData shape.
        Parameters:
        x - The x-coordinate of the top-left corner.
        y - The y-coordinate of the top-left corner.
        width - The width of the rectangle.
        height - The height of the rectangle.
      • getCoordinates

        public double[] getCoordinates()
        Gets the coordinates of the RectangleData shape.
        Returns:
        Array of coordinates containing {X,Y,Width,Height}.
      • setCoordinates

        public void setCoordinates​(double[] coordinates)
        Sets the coordinates of the RectangleData shape.
        Parameters:
        coordinates - Array of coordinates containing {X,Y,Width,Height}.