Guest User

Untitled

a guest
Apr 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1. public class Doodle
  2. {
  3.     private Pen pen;
  4.     /**
  5.      * A constructor which creates a default canvas
  6.      */
  7.     public Doodle()
  8.     {
  9.         new Pen(280, 220, new Canvas("My canvas", 560, 440));
  10.     }
  11.    
  12.     /**
  13.      * A method that pauses the program for the given length of
  14.      * time, in milliseconds.
  15.      * This can be used when you want to animate with
  16.      * a delay between drawings.
  17.      *
  18.      * @param howLong How long to pause for, in milliseconds.
  19.      */
  20.     private void pause(long howLong)
  21.     {
  22.         try {
  23.             Thread.sleep(howLong);
  24.         }
  25.         catch(InterruptedException e) {
  26.         }
  27.     }
  28.    
  29.     /**
  30.      * A method which draws a line between two points
  31.      * @param startX The starting x co-ordinate
  32.      * @param startY The starting y co-ordinate
  33.      * @param endX The ending x co-ordinate
  34.      * @param endY The ending y co-ordinate
  35.      */
  36.     public void betweenTwoPoints(int startX, int startY)
  37.     {
  38.     }
  39.    
  40.     /**
  41.      * Draw a square
  42.      * @param length The length of the four sides of the square
  43.      */
  44.     public void square(int length)
  45.     {
  46.     }
  47. }
Add Comment
Please, Sign In to add comment