Class Rectangle

    • Constructor Detail

      • Rectangle

        public Rectangle​(GraphPoint center,
                         double width,
                         double height,
                         GraphicAttributes attributes)
        Creates a new instance.
        Parameters:
        center - The position of the center of this element.
        width - The width.
        height - The height.
        attributes - Drawing attributes. Can be null.
    • Method Detail

      • getCenter

        public GraphPoint getCenter()
        Returns the center of this element.
      • getWidth

        public double getWidth()
        Returns the width of this element.
      • getHeight

        public double getHeight()
        Returns the height of this element.
      • renderWith

        public void renderWith​(Renderer renderer)
        Renders this rectangle with the specified Renderer.
        Parameters:
        renderer - An instance of RectangleRenderer.
        Throws:
        java.lang.IllegalArgumentException - if renderer is not an instance of RectangleRenderer.