GUI and Graphics Case Study Exercises
10.1 Modify the
MyRectangle classes of GUI and Graphics Case Study Exercise 8.1 and Exercise 9.1 to create the class hierarchy in Fig. 10.17. Classes of the
MyShape hierarchy should be “smart” shape classes that know how to draw themselves (if provided with a
Graphics object that tells them where to draw). Once the program creates an object from this hierarchy, it can manipulate it polymorphically for the rest of its lifetime as a
In your solution, class
MyShape in Fig. 10.17 must be
MyShape represents any shape in general, you cannot ...