Class Diagrams for Trees3DFigure 28-2 shows the class diagrams for the TRees3D application. The class names and public methods are shown. trees3D is the top-level JFrame for the application, and WrapTrees3D sets up the scene. It initially creates five treeLimb objects, representing five tree limbs. New limbs sprout from these, creating trees like those in Figure 28-1. TReeLimb encodes the animation component, so it offers many methods for changing a limb (e.g., making it grow longer, thicker, and changing color). The leaves at the end of a tree limb are represented by two ImagesCsSeries screens that show pictures of leaves. The images can be changed to give the effect the leaves are changing. The rules are implemented in the GrowthBehavior object and evaluated every 100 ms. Figure 28-2. Class diagrams for Trees3D
|