The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Putting It All Together
Lesson: BINGO!

The Primary Classes

The Engine of the Game

The following is a diagram of the classes that make up the Game's "engine":


This figure has been reduced to fit on the page.
Click the image to view it at its natural size.


Note: This diagram does not include all of the classes that comprise the Game application. Rather it just shows the key classes. Later pages in this lesson include other diagrams that show the some of the relationships between the other classes.
The BINGO (in a .java source file) class contains the main method for the Game application, so let's begin there. BINGO creates a RingMaster (in a .java source file) object. The RingMaster is the most central object of the Game application and provides much of the code that glues everything together. The RingMaster creates many helper objects such as the NotaryPublic (in a .java source file) for signing BINGO cards, the Roster (in a .java source file) for keeping track of registered players, and so on.

The main method also creates three other objects: a RegistrarImpl (in a .java source file) object (which handles all RMI requests from Players), and a ControlPane (in a .java source file) and an OverallStatusPane (in a .java source file) (both of which implement parts of the Game's user interface).

When the user clicks the Let the Games Begin button, the ControlPane creates and starts a GamesThread (in a .java source file) which creates and starts a new BallAnnouncer (in a .java source file) for each game.

The Game's User Interface

The following is a diagram of the classes that implement the Game's user interface:


This figure has been reduced to fit on the page.
Click the image to view it at its natural size.

The classes above and to the left of the swoosh are in the bingo.game package. The classes below and to the right of the swoosh are in the bingo.shared package because they do not depend directly on any code in the Game and they can be shared by the Player (as LightBoardPane (in a .java source file) and GameStatusLabel (in a .java source file) are).

The best way to understand the classes that make up the Game's UI is to identify the areas of the user interface that each class controls. So, here's a box diagram that shows you what class controls each area of the Game's user interface:

[PENDING: put in a snapshot of the game with callouts indicating which classes control which part of the window]

Using the JFC to Implement the UI's contains similar box diagrams, but instead of showing the BINGO classes that implement each area of the user interface, they show you which Swing components are used in the GUI elements (either because the classes shown here create Swing objects or subclass the classes).

The Player

The following is a diagram of the classes that make up the Player application:

[PENDING]

A Legend of the Symbols Used in the Diagrams


This figure has been reduced to fit on the page.
Click the image to view it at its natural size.


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.