// Aaron Tan
// 
// To test out BallV2GUI class 
// Note that the screen that displays the ball has a size of 
// 300 by 300 (defined in Canvas class).
// Note also that in graphics, the bigger the y-coordinate value
// of an object, the further down the object appears. 

import java.util.*;

public class TestBallV2GUI {

   public static void main(String[] args) {

      Scanner scanner = new Scanner(System.in);
      String inputColour;
      double inputRadius;
      int    inputXCoord, inputYCoord;

      // Read inputs from user
      System.out.print("Enter colour: ");
      inputColour = scanner.next();
      System.out.print("Enter radius: ");
      inputRadius = scanner.nextDouble();
      System.out.print("Enter centre's x- and y-coordinates: ");
      inputXCoord = scanner.nextInt();
      inputYCoord = scanner.nextInt();
      
      // Create a default BallV2 object
      BallV2GUI myBall = new BallV2GUI();

      // Set the colour and radius of this BallV2 object
      myBall.setColour(inputColour);
      myBall.setRadius(inputRadius);
      myBall.setCentre(inputXCoord, inputYCoord);

      // Display the contents of the Ball object
      System.out.println("Colour is " + myBall.getColour());
      System.out.println("Radius is " + myBall.getRadius());
      System.out.println("Centre is (" + myBall.getXCoord() + ","
                          + myBall.getYCoord() + ")");

      // show the object on screen
      myBall.makeVisible();

      // Move the object
      System.out.print("Distance to move horizontally: ");
      int dist = scanner.nextInt();
      myBall.moveHorizontal(dist);

      System.out.print("Distance to move vertically  : ");
      dist = scanner.nextInt();
      myBall.moveVertical(dist);

      // Display new centre
      System.out.println("Centre is (" + myBall.getXCoord() + ","
                          + myBall.getYCoord() + ")");
      
   }

}

