Functional Index of Classes in the Grid Package
The Grid Package includes classes for modeling objects in a two-dimensional
grid, classes for graphically displaying a grid and the objects it, and classes
for creating graphical user interfaces for grid-based applications. The
class documentation (API) for the
package includes javadoc-generated documentation for every class, organized
alphabetically and by package. This document, on the other hand, provides a
list of the classes organized functionally in the following sections:
Classes for modeling a grid and the objects in it
Classes for displaying a grid and the objects in it
Classes for constructing grid-based graphical user interfaces
Utility classes
In addition, there is an Overview document that
covers the origins of the Grid Package, its purpose, an
explanation of how to use its classes, and how to create and run an
application. Two other documents, Understanding
the Display Component Classes and Creating and
Extending Grid Package Classes,
provide information
about customizing the Grid Package, especially through creating new classes
and subclasses.
Classes for modeling a grid and the objects in it (edu.kzoo.grid
package):
*Grid |
the abstract class that represents a grid; concrete extensions of this class
may support a variety of internal representations |
*Location |
the class that encapsulates the row and column
information for grid cell locations |
*Direction |
a class whose objects represent compass directions
for navigating within a grid |
*GridObject |
the abstract class that represents objects in
a grid; all objects in a grid must be instances of the GridObject class
or a subclasses |
Some Handy GridObject
Subclasses
ColorBlock |
represents a block of color in a cell |
TextCell |
represents a string of text in a cell (works best for
shorter strings) |
PictureBlock |
represents a picture (a GIF or JPG image, for example)
in a cell |
Classes for displaying a grid and the objects in it (edu.kzoo.grid.display
package):
*GridDisplay |
interface that specifies the methods that are used to display a grid
and its contents |
*GridBackgroundDisplay
| specifies the single drawBackground method
(Note: this has nothing to do with drawing grid lines, which are handled by methods
in ScrollableGridDisplay )
|
Classes that Implement the GridBackgroundDisplay
Interface
ScrollableGridDisplay
| the basic GridDisplay class
implements the GridBackgroundDisplay interface also,
merely filling in the background with a single color |
CheckeredBackgroundDisplay
| drawBackground draws a checkered background
such as might be used to represent a board game |
*GridObjectDisplay
| interface that specifies the methods used by ScrollableGridDisplay to
display the individual objects in the grid |
ScaledDisplay
| abstract class that
provides methods for scaling the display of an object |
Handy ScaledDisplay
Subclasses
TextDisplay
| displays a text string, centered in a specific cell; the string
will be colored if the object being displayed has a color method |
TextCellDisplay
| displays a
TextCell object in the appropriate cell; throws an exception if
the object it is displaying does not have a text method or color method,
as TextCell does |
DefaultDisplay
| displays a question
mark (possibly colored) in the appropriate cell |
ColorBlockDisplay
| paints the
appropriate cell with the color specified by the object in that cell |
ScaledImageDisplay
| displays an image
in the appropriate cell (the same image for all objects of the class with which
the display object is associated) |
PictureBlockDisplay
| displays the
image specified by the object in that cell (each object may specify a different
image) |
*DisplayDecorator
| interface for decorator classes that can be applied
to GridObjectDisplay objects
|
RotatedDecorator
| rotates the display of a grid object
based on an object's direction; the object must have a direction method |
ScaledImageTintDecorator
| tints an image display
based on an object's color; the grid object must have a color method
and the display to which the decorator is applied must be a ScaledImageDisplay |
*DisplayMap
| used to associate specific display objects with
various GridObject classes |
Other support classes (used internally by
other classes in the edu.kzoo.grid.display package):
|
DefaultDisplayFactory
| finds or creates suitable default
displays for classes, such as a ClassName Display object,
a ScaledImageDisplay for a ClassName .gif or
ClassName .jpg image, or a DefaultDisplay object |
PseudoInfiniteViewport
| a JViewport subclass that
translates scroll actions into pan actions across an unbounded view |
TextAndIconRenderer
| provides a renderer that paints
both the text and the icon of a JLabel |
Classes for constructing grid-based graphical user interfaces
(edu.kzoo.grid.gui
and edu.kzoo.grid.gui.nuggets
packages):
*GridAppFrame |
a basic graphical user interface for a grid-based application; supports:
| menus | includeMenu |
| speed slider bar | includeSpeedSlider |
| components
(e.g., buttons, drop-down menus) | includeControlComponent |
|
*GridEditor |
specialized GridAppFrame for editing the contents of a grid;
provides an editing palette, a display, and a Done button (can be subclassed
to provide other functions) |
|
*SteppedGridAppFrame |
a graphical user interface for stepped grid-based applications; supports:
|
set/initialize/reset buttons |
includeSetResetButton |
|
a button to execute 1 step | includeStepOnceButton |
|
button to execute application N steps | includeStepNTimesButton |
| button to run application indefinitely |
includeRunButton |
| button to stop a running application |
includeStopButton |
|
Controller Classes for Controlling a Stepped Grid Application
Other support classes (used by
other classes in the edu.kzoo.grid.gui package or customized
subclasses):
|
GridChangeListener
|
defines the type for components that need to be notified of a new grid
(e.g., some menu components) |
GridPkgFactory
|
for constructing grids and the objects they contain, and for keeping
track of what types of grids or grid objects are available to a specific application |
GridChoiceComboBox
|
a drop-down menu offering choices of bounded or unbounded grids known to
the GridPkgFactory |
GridFileChooser
|
a file chooser dialog that supports choosing a data file ending in
.dat that contains information about a bounded or unbounded
grid |
ColorChoiceDDMenu |
a drop-down menu for choosing a color |
Utility classes (edu.kzoo.util
package):
*Debug |
supports conditional printing of debugging messages |
*NamedColor |
extends the java.awt.Color class to associate names with
colors and to provide static methods that generate random colors |
*RandNumGenerator |
provides a singleton object for random number generation |
*ValidatedInputReader |
provides numerous static methods that will put up a dialog box prompting
the user for input and validate the responses |