Interface GeometryDrawer



  • public interface GeometryDrawer
    • Method Summary

      Modifier and Type Method and Description
      void drawCircle(double x, double y, double radius, DrawMode mode)
      Draw a circle.
      void drawGeometry(Geometry g, DrawMode mode)
      Draw the given geometry on this surface.
      void drawRectangle(double x, double y, double width, double height, DrawMode mode)
      Draw a rectangle that is defined by a top left position and a width and height.
      void drawRectangleAbsolute(double x1, double y1, double x2, double y2, DrawMode mode)
      Draw a rectangle that is defined by it's absolute positions of each corner.
      void drawRectangleCentered(double x, double y, double width, double height, DrawMode mode)
      Draw a rectangle that is defined by a center position and a width and height.
      void drawSegment(double x1, double y1, double x2, double y2)
      Draw a segment on the surface.
      void drawString(double x, double y, String text, int fontsize, int xoff, int yoff)
      Draw this string to the given position.
      void setColorBackground(ColorCode c)
      Set the color to use for filling in future drawing operations.
      void setColorForeground(ColorCode c)
      Set the color to use for lines in future drawing operations.
      void setLineWidth(double width)
      Set the width of lines in future drawing operations.
    • Method Detail

      • setColorForeground

        void setColorForeground(ColorCode c)
        Set the color to use for lines in future drawing operations.
        Parameters:
        c - the color for lines.
      • setColorBackground

        void setColorBackground(ColorCode c)
        Set the color to use for filling in future drawing operations.
        Parameters:
        c - the color for fillings.
      • setLineWidth

        void setLineWidth(double width)
        Set the width of lines in future drawing operations.
        Parameters:
        width - the width of lines.
      • drawGeometry

        void drawGeometry(Geometry g,
                          DrawMode mode)
        Draw the given geometry on this surface.
        Parameters:
        g - the geometry to draw.
        mode - the drawing mode
      • drawSegment

        void drawSegment(double x1,
                         double y1,
                         double x2,
                         double y2)
        Draw a segment on the surface.
        Parameters:
        x1 - the first coordinate's x component
        y1 - the first coordinate's y component
        x2 - the second coordinate's x component
        y2 - the second coordinate's y component
      • drawRectangleAbsolute

        void drawRectangleAbsolute(double x1,
                                   double y1,
                                   double x2,
                                   double y2,
                                   DrawMode mode)
        Draw a rectangle that is defined by it's absolute positions of each corner.
        Parameters:
        x1 - the left x coordinate.
        y1 - the top y coordinate.
        x2 - the right x coordinate.
        y2 - the bottom y coordinate.
        mode - the drawing mode
      • drawRectangle

        void drawRectangle(double x,
                           double y,
                           double width,
                           double height,
                           DrawMode mode)
        Draw a rectangle that is defined by a top left position and a width and height.
        Parameters:
        x - the left x coordinate.
        y - the top y coordinate.
        width - the width of the rectangle.
        height - the height of the rectangle.
        mode - the drawing mode
      • drawRectangleCentered

        void drawRectangleCentered(double x,
                                   double y,
                                   double width,
                                   double height,
                                   DrawMode mode)
        Draw a rectangle that is defined by a center position and a width and height.
        Parameters:
        x - the center x coordinate.
        y - the center y coordinate.
        width - the width of the rectangle.
        height - the height of the rectangle.
        mode - the drawing mode
      • drawCircle

        void drawCircle(double x,
                        double y,
                        double radius,
                        DrawMode mode)
        Draw a circle.
        Parameters:
        x - the x coordinate of the circle's center.
        y - the y coordinate of the circle's center.
        radius - the radius.
        mode - the drawing mode
      • drawString

        void drawString(double x,
                        double y,
                        String text,
                        int fontsize,
                        int xoff,
                        int yoff)
        Draw this string to the given position.
        Parameters:
        x - position coordinate
        y - position coordinate
        text - the text to draw
        fontsize - the size of font
        xoff - x offset in image space
        yoff - y offset in image space