Package bagel

Class Drawing

java.lang.Object
bagel.Drawing

public class Drawing extends Object
Contains utility methods for drawing various shapes.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    drawCircle(double x, double y, double radius, Colour colour)
    Draw a circle of the given radius and colour, centred at the point (x, y).
    static void
    drawCircle(Point centre, double radius, Colour colour)
    Draw a circle of the given radius and colour, centred at the provided point.
    static void
    drawLine(Point a, Point b, double thickness, Colour colour)
    Draw a line of the given thickness and colour from point a to point b.
    static void
    drawRectangle(double x, double y, double width, double height, Colour colour)
    Draw a rectangle with its top-left at (x, y) with the provided width, height, and colour.
    static void
    drawRectangle(Point topLeft, double width, double height, Colour colour)
    Draw a rectangle using a Point to specify the top-left.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Drawing

      public Drawing()
  • Method Details

    • drawRectangle

      public static void drawRectangle(double x, double y, double width, double height, Colour colour)
      Draw a rectangle with its top-left at (x, y) with the provided width, height, and colour.
    • drawRectangle

      public static void drawRectangle(Point topLeft, double width, double height, Colour colour)
      Draw a rectangle using a Point to specify the top-left.
    • drawLine

      public static void drawLine(Point a, Point b, double thickness, Colour colour)
      Draw a line of the given thickness and colour from point a to point b.
    • drawCircle

      public static void drawCircle(Point centre, double radius, Colour colour)
      Draw a circle of the given radius and colour, centred at the provided point. (Warning: this is not very efficient.)
    • drawCircle

      public static void drawCircle(double x, double y, double radius, Colour colour)
      Draw a circle of the given radius and colour, centred at the point (x, y). (Warning: this is not very efficient.)