Assignment #5: Graph Pad with Input



Back to graphics.
This time you have to extend the graphics program from assignment 4 with user console input.

Your task in detail:
I'll provide the all classes needed except 'GraphicsControl'. They are slightly modified, so please use the new versions. Do NOT use your own solutions to assignment 4 unless you REALLY know what's going on.
You have to rewrite GraphicsControl in a way that it asks the user for input, e.g. if he/she wants to draw a line, rectangle or circle, and then for the input parameters needed, so there's no predefined graphic inside of the program this time, the user is able to create a graphic.
Since we deal with user input, all errors the user could possibly make must be caught by exceptions.

For the input you should use the class 'SavitchIn', which offers 2 static methods:
public static char readLineNonwhiteChar()
and
public static int readInt() throws NumberFormatException

The program should first ask the user for the object to draw:
System.out.print("Type: (l)ine (r)ectangle (c)ircle e(x)it:");

then read the data for the specific object, e.g. for the line:
Start x:
Start y:
End x:
End y:

After the object is specified, it must be put into the GraphicsObject array (theList[]). This list is used as input to create a new GraphicsEngine, which shows all objects in theList, same as in assignment 4.

If something happens (exception!), the program should catch it, report, and go on. no crash.
The maximum number of objects to be drawn should be 10, this is needed for the array dimensions. Please also catch if the user tries do draw more than that.


The files needed are here, i also included a template of GraphicsEngine, the file you have to modify. THE FILES

I will explain further details in class, the TA will do the same in the lab.