There is no starter code this time, but you'll find several useful examples posted on the class calendar and in Lab #3.

The goal is that when the program runs, a frame will be displayed with a number of shapes drawn on it. (See the shapes below).

Your code should be organized using the following classes and interfaces:

__Interface Shape__. The minimal interface of a shape. This should include, at least, a method to draw the Shape on a java Graphics object. As the program evolves, you may need to add additional methods to this interface, but keep it as small as possible for now. (At this point, there should not be any code to handle events. Event handling will be included in the next installment of this assignment.)

__Class AbstractShape__. This should be an*abstract*class that implements interface Shape. Add instance variables, additional methods and default implementations here once it becomes clear that all Shapes need to have such fields and methods.

- Specific concrete shape classes that extend AbstractShape:
__FibonacciSquare__

The constructor of the fibonacci square should take 5 parameters: int x, int y, Color c, int quadrant and int n.

(x, y) are the coordinates of the location of the square (you can choose which point the coordinates (x,y) represent, e.g. the top left corner of the square, or the center of the square).

c is the color of the square and the arc.

quadrant is the corresponding quadrant of the arc (= a quarter circle.) There are four ways to draw the arc within the square. We will label the four possible arcs by the quadrant they would be in if the arc was part of a full circle centered at the origin, that is:

is an arc in quadrant 1

is an arc in quadrant 2

is an arc in quadrant 3

is an arc in quadrant 4

Finally, n refers to the nth fibonacci number F_{n}in the fibonacci sequence, which we take to be the length of the side of the square. Fibonacci numbers are defined by the sequence F_{1}=1, F_{2}=1, F_{3}=2, F_{4}=3, F_{5}=5, F_{6}=8, etc. The nth fibonacci number F_{n}of the sequence is defined as the sum of the n-1 and n-2 fibonacci numbers F_{n-1}and F_{n-2}, i.e. F_{n}= F_{n-1}+ F_{n-2}. For instance, F_{4}= 3 = F_{3}+ F_{2}= 2 + 1. Fibonacci numbers have fascinating properties which you can read about on wikipedia.

In hw4, you will create a tiling of the fibonacci squares to draw a fibonacci spiral.

__HShape__: .

The constructor of the H shape should take 4 parameters: int x, int y, Color c, and int size.

(x, y) are the coordinates of the location of the shape (as for the fibonacci square, the precise location of the point with coordinates (x,y) is your choice).

c is the color the H shape

size is the length of the side of the square that contains the H shape.

To draw the H, divide the square that contains the H into 9 identical smaller squares and color 7 of them as shown below.

In hw4, the H will be divided into smaller H's to create a fractal pattern.

The two classes FibonacciSquare and HShape should also have a method that returns a deep copy of its calling object (this is so that the model can return a deep copy of its lists of shapes. See below). Do so by implementing a method such as public Shape deepCopy() whose declaration could be written in the Shape interface. And of course, make sure that the copy is a deep copy.

You can also choose to make some other classes if you like, such as diamonds, ovals, rectangles, composite shapes, etc.

- Class DrawingModel. This is the model that holds the state of the
drawing, and will probably be the most complex class. It should maintain
a collection of Shapes. The model should look at all of the shapes as having just a Shape type. It should not have to distinguish between Triangles and Squares (and other types of shapes if you have them). When requested by a view, the model should make a
__deep copy__of the collection of its shapes ( use the deep copy method of the Shape interface implemented in the Triangle and Square classes). Other behaviors it should support are- A client should be able to add a Shape to the model
- A viewer should be able to register with the model
- It should notify all viewers when something in the model changes. (For now, the only changes will be when a new shape is added to the drawing.)

- Interface View. This interface should describe the minimal information about a viewer needed for the DrawingModel to interact with it (probably just an update method).
- A viewer class that extends JPanel and implements View. When notified of changes in the DrawingModel, it should draw all shapes from the model within the panel.

- MainClass program. Create a class with a main method that creates
the DrawingModel and Viewer and sets them up so that the state of the DrawingModel
is displayed within a JFrame. Create some fibonacci squares and H's
(and any other shapes you have) with different colors, sizes, and locations
and have them displayed to the user (by adding them to the model.) For the fibonacci squares,
__make sure that all four possible arcs are displayed__.

Make sure you have documented your public interfaces well. Remember, you are building these classes from scratch. No one has any idea of what they do except you. You need to communicate these ideas to the reader.

- Planning: How did you plan and organize your program? What does it do?
- Implementation: How is your program organized? What are the major classes? How do the objects interact? Draw a diagram.
- Testing: How did you test your code? What sort of bugs did you encounter? Are there any unresolved problems in the code?
- Evaluate this project. What did you learn from it? Was it worth the effort? This could include things you learned about specifications and interfaces, design issues, Java language issues, debugging, etc.

Turn in your report as a pdf file along with your java files on the turn-in page.