Class Diagrams for Lathe3DFigure 17-2 shows the class diagrams for the Lathe3D application. The class names, as well as the public and protected methods, are shown. Figure 17-2. Class diagrams for Lathe3D
Lathe3D is the top-level JFrame and similar to earlier examples: It's the application window holding a 3D canvas made by WrapLathe3D. WrapLathe3D sets up the 3D world like previous wrap classes: it creates the checkerboard, the lights, background, and mouse controls. The only change is a large method called addLatheShapes( ) that makes multiple calls to LatheShape3D (and its subclasses) to create the shapes shown in Figure 17-1. CheckerFloor and ColouredTiles are unchanged from previous chapters. LatheShape3D creates a shape using a LatheCurve object to create the lathe curve. The subclasses of LatheShape3D (EllipseShape3D and RhodoneaShape3D) are examples showing how the rotation path employed by LatheShape3D can be modified.
|