Title: A GUI for the Mail Delivery Robot

DESCRIPTION:
In this assignment you will be able to exploit the Model-View-Controller
pattern for building an application by developing a GUI for Control and View
of the purely character-oriented Model developed on Assignment#2 for the
Mail Delivery Robot. You can use your own solution to Assignment#2 or you can
adopt the Key solution posted to the WebSite.

Your task is to produce a GUI that will provide a graphical(VIEW) representation
of the Robot, Building and Elevator objects and provide for User interaction
with a set of Elevator command buttons.


DEVELOPING YOUR CONTROL AND VIEW GUI FOR THE ROBOT AND FLOORS:
One way of accomplishing this is by interpreting the two-dimensional character
arrays corresponding to the Building Floors in terms of a set of Tile objects
each one representing a corresponding character from the Layouts. The Robot
itself will have its own Tile which will change shape as the Robot direction
changes. All these different classes could inherit from a basic Tile class that
just draws a particularly colored rectangle at a given pixel position
coordinates. The original character coordinates in the floorLayout "Model" can
be used to compute the actual position of these Tile sub-classes. For example
the Tile class can have a draw() method that receives the character that the
Tile object should represent and the row/col coordinates where the Tile should
be painted, a third parameter could be a reference to the Panel where the Tile
should paint itself. Then it invokes the drawRectangle() method on the
graph that the paintComponent method of the panel receives from swing on
every repaint operation.

Another way of drawing the floors is to directly draw into a panel by
having a method that determines the view shape for a given character
from the floor layout model. Then you directly draw that shape using
the (overriden) paintComponent() method of the panel where layout will
be drawn.

Using the row/col coordinates for the character, the actual x/y pixel
coordinates where the Tile should be drawn can be computed as follows:
  x = col * Tile.WIDTH;
  y = row * Tile.HEIGHT;

Once you have defined a Tile class or shape for vertical, horizontal, and corners
wall sections, and for MailBoxes and the Robot, you can define a method that
will replace/overload the current Floor class printLayout() method.The new
method replaces the System.out.println() call by the instantiation/drawing of the
graphical pixel-wise representation of the Tile class object/shape corresponding
to the character to be printed, and uses the array coordinates of character to
position that Tile sub-class object/shape within the Building display frame(see above).
(You may change the current layout slightly so that you code each corner type
with a different character, so you produce four different corners)

Similarly to depict the Robot's movement within a given floor you will modify
the Robot class step() method so that after a new robot position and orientation
is determined and the Robot's character 'R' is written to the floor layout array
(i.e. the Model is updated) the View is also updated. This can be accomplished
by replacing the old Robot previous position tile with a plain Tile (open
floor area) graphical object/shape, and instantiating/drawing a new Robot Tile
class object/shape and sending it a draw() message with the new Robot coordinates,
the new direction, and a reference to the Building view frame.

You may also want to give the Robot the responsibility to send a message to
the Floor asking that it draws itself every time, the Robot arrives at a
new floor.

In the interest of maintaining a separation of concerns between Model and View
it would be desirable that you do not modify the "Model" aspects of the
current application, but instead focus on dealing with the display of the
"View" part of the application.

Bonus Section I: (10points)
DEVELOPING YOUR CONTROL AND VIEW GUI FOR THE ELEVATOR:
A separate frame or panel should be used to provide a vertical cross section
of the elevator shaft with the different floors clearly delimited. You can
Model the elevator object similarly to the way the floors are being modeled
although this is not strictly necessary as you do not need to detect walls,
and other obstacles as done for floors. However you may like to re-use the
Tile classes that represent walls etc.. For example your elevator Model
vertical cross section may look like the drawing below which shows the
elevator at the second floor with the Robot inside.

        +-----+
        |     |
        |     |
        |     |
  Floor4|     |
        +-----+
        |     |
        |     |
        |     |
  Floor3|     |
        +-----+
        |+---+|
        ||   ||
        || R ||
  Floor2|+---+|
        +-----+
        |     |
        |     |
        |     |
  Floor1|     |
  ------+-----+

     +-+-+-+-+
     |1|2|3|4|
     +-+-+-+-+
    user controls

You are required to provide the Elevator with an external set of control
buttons, (JButtons, or JRadioButtons/ButtonGroup) that will allow you to
use the mouse to click such buttons and cause the elevator to move to that
floor. Your buttons listener can ask the elevator to move to a given floor,
however you must make sure that appropriate synchronization is provided between
the Elevator class move methods such that either Robot request or User
requests are executed in a mutually exclusive way. Note that the current
Elevator method moveRobTo() and callFrom() are not synchronized.


Bonus Section II: (10 additional points)
MAKING THE ROBOT AUTONOMOUS:
The Robot object should be made to execute in an independent and autonomous
way by running it inside its own thread. The Robot class could implement the
Runnable interface, and the instantiated robot object passed to a Thread
object (i.e. wrapped inside a Thread) before starting that thread through its
start() method. This will allow the Robot to execute concurrently with Elevator
movements initiated by the User when cliking the Elevator buttons.


OUTPUT:
Your output should consist of one or two JFrames. One showing the Robot moving
through a floor deliverying mail, taking the elevator to the next floor, and invoking
the displayFloor() method on that floor, etc.. The other (Bonus I) showing the Elevator
moving to particular floors as a result of Mouse click request on the elevator
buttons, or from Robot requests. The Bonus two behaviour will be demonstrated by
cliking the elevator floor-request buttons while the Robot is inside the elevator.
Optionally you may want to show a JFrame or JPanel with a scrollable TextArea
displaying the basic Model mail delivery messages when each mailBox with
a mailPiece is reached. This last feature allows to verify that the View is indeed
an accurate depiction of the Model state.