Class RectangleElement

    • Field Detail

      • xCoord

        public final double xCoord
        The x-coordinate of the center of the rectangle.
      • yCoord

        public final double yCoord
        The y-coordinate of the center of the rectangle.
      • width

        public final double width
        The width of the rectangle.
      • height

        public final double height
        The height of the rectangle.
      • filled

        public final boolean filled
        If true, the rectangle is drawn as filled.
      • color

        public final Color color
        The color of the rectangle.
    • Constructor Detail

      • RectangleElement

        public RectangleElement​(double xCoord1,
                                double yCoord1,
                                double xCoord2,
                                double yCoord2,
                                Color color)
        Make a rectangle from two opposite corners (x1, y1) and (x2, y2).
        Parameters:
        xCoord1 - the x-coordinate of the first point
        yCoord1 - the y-coordinate of the first point
        xCoord2 - the x-coordinate of the second point
        yCoord2 - the y-coordinate of the second point
        color - the color of the rectangle
      • RectangleElement

        public RectangleElement​(double xCoord,
                                double yCoord,
                                double width,
                                double height,
                                boolean filled,
                                Color color)
        Make a rectangle centered on (x, y).
        Parameters:
        xCoord - x-coordinate of the center of the rectangle
        yCoord - y-coordinate of the center of the rectangle
        width - width of the rectangle
        height - height of the rectangle
        filled - if true, the rectangle is drawn as filled
        color - the color of the rectangle