Project 2

Create an Applet that acts as computerized coloring book.  An example of such a coloring book is the following truck:
</COMMENT>

Note how the colors of components (including the background!) change when you click on them with the mouse.  Note also how only one component changes its color each time.  Each component goes through the same sequence of colors.

Choose any object (or the given truck) to develop such a coloring book.  Your object MUST have at least two shapes (such as rectangular and circular) and at least two overlapping components.  The overlapping areas must not change the way they overlap when clicking on different parts of the picture.

When you implement the coloring book, create one class myArea that implements an individual coloring area (such as a wheel, the background, etc.).  myArea should contain all the functionality (color changes, checking if a click occurs within the given area, drawing) but should not specialize on a particular shape.  You can use the Area  class in java.awt.geom  for your implementation but you don't have to.

Note that cannot use RectangularShape  as a superclass to myArea because you will want to use existing subclasses such as Ellipse2D.  Instead you may need an object of class RectangularShape  as part of myArea (Note that class Area  is designed to contain shapes in just this way.) This amounts to saying that, e.g., the cab "has a" shape of a rectangle (shape as instance variable).  It would not be practical to treat a coloring area as if it "is a" rectangle (inherit from shape).