Class Diagrams for Mover3DFigure 20-7 shows the class diagrams for the Mover3D application. The class names, public and protected methods, and data are shown. Figure 20-7. Class diagrams for Mover3DMover3D is the top-level JFrame for the application, containing two JPanels. The 3D scene is created in WrapMover3D and displayed in its panel, the text field for entering commands and Reset button are managed by CommandsPanel. The LocationBeh behavior deals with user input via the keyboard, and enables the figure to be moved and rotated.WrapMover3D creates the usual checkerboard scene, using the CheckerFloor and ColouredTiles classes (first used in Chapter 15) to create the floor. The scene contains one Figure object that represents the figure as a series of connected shapes created from the Limb class and its subclasses (MoveableLimb, MoveableEllipticLimb, and EllipticLimb). The shape of a limb is specified using a LatheShape3D or EllipseShape3D object, both described in Chapter 17. The choice depends on the cross-sectional shape you want for a limb: LatheShape3D offers a circular cross-section suitable for arms and legs, and EllipseShape3D is a better choice for a torso (which is closer to elliptical).
|