Class Diagrams for the ApplicationFigure 6-2 shows the class diagrams for the ImagesTests application. The class names, public methods, and constants are shown. ImagesTests creates a JFrame and the JPanel where the images are drawn, and it starts a Swing timer to update its images every 0.1 second. ImagesTests employs an ImagesLoader object to load the images named in a configuration file (imsInfo.txt in the Images/ subdirectory). ImagesLoader will be used in several subsequent chapters to load images and animations into my games. The visual effects methods, such as blurring, are grouped together in ImagesSFXs. Animations represented by sequences of images (e.g., numbers, cars, kaboom, cats, and figure) are controlled by ImagesPlayer objects. A sequence may be shown repeatedly, stopped, and restarted. A completed animation sequence can call sequenceEnded( ) in an object implementing the ImagesPlayerWatcher interface. ImagesTests implements ImagesPlayerWatcher and is used as a callback by the numbers sequence. |