Many of the smaller tasks which Java developers are required to take on within a larger project can take on the air of a larger project all on their own. Developing a grid control can be one of those tasks. Many companies have responded to this need by creating their own "plug-and-play" grids for Java developers to implement in their own projects. Stingray's Objective Grid for Java is a fine example of tools which can enhance a Java application and shorten design time. Developers can use the Objective Grid control anywhere they can use an AWT control, saving time and effort.
Visually, Objective Grid tends to remind me of the typical spreadsheet, with rows and columns to hold the data (see Figure 1). I can remember when I first saw how Web pages were created using standard HTML, I thought to myself that what the Web needed was a way to use spreadsheets with dropdown combo boxes, listboxes, images, masked input and buttons. Along came Java and the door was opened, but it still had its limitations - the main one of which was the time it would take to include this functionality in an applet or application. Using Objective Grid, the programmer is able not only to include these features in their project, but also to include editing functions such as find and replace, undo and redo and, if the programmer is using the 1.1 version of the JDK, even the ability to print. The grid can also be bound to external data sources using the JDBC. So what exactly is Objective Grid/J?
Objective Grid/J is a package of Java extension classes that implements a user interface component which displays data in rows and columns. The user interface is known as a grid control and enables end-users to manipulate and edit the data which is displayed within it. Version 1.2 now enables developers to give their applets and applications an Excel-like look and feel. Objective Grid/J also allows developers using the latest releases of Visual J++, Symantec Café, Symantec Visual Café and Supercede to include grids in their applets and applications.
Objective Grid includes complete project files for the libraries as well as the demos, including source code for every class. The Objective Grid package is actually composed of several groups of Java extension classes which work together to create the grid effects mentioned above. These classes include:
- Drawing Classes: The drawing classes actually perform the drawing and updating of cells that are displayed. The base GXGridCore class is derived from the AWT Panel class, and classes are provided to include a binary runtime of Stingray's Objective Blend product.
- Control Classes: Grid cells may be any of a variety of control types; several pre-built controls are ready to be placed in as cell types (you can also embed your own custom controls as cell types).
- Style Classes: The Objective Grid style classes manage attributes of a cell (or group of cells) and provide a pre-built dialog which is used to modify them.
- Browser Classes: The Browser classes enable the programmer to browse external data sources by overriding some of the virtual methods.
- JDBC Classes: The JDBC classes provide grid access to JDBC databases.
- Symantec dbAnywhere Classes: The Symantec dbAnywhere classes provide grid access to databases accessed when using Symantec's dbAnywhere software.
- Utility Classes: Objective Grid uses many Java extension classes for internal utility classes. The uses of the utility classes include tabbed windows, the undo/redo architecture, etc. The tabbed panel class (see Figure 2) showcases a row of tab buttons with different Panels associated with each "tab." They can be initialized to be placed at the top of the panel or at the bottom of the panel, allowing a variety of uses.
Objective Grid/J also includes an Objective Grid Guide and a FAQ in Microsoft Word format. In the Guide are tutorials that take you through each of the five included examples:
- FirstGrid (see Figure 3)
When you are ready to examine the examples, you must build the complete OG/J package. OG/J comes with several pre-built packages and you have to set your CLASSPATH environment variable to include them.
Also included in the Guide is an Objective Grid and Objective Blend Reference that covers all the classes in detail. Additional chapters of the Guide show the programmer how to add their own controls, use the Undo and Redo feathers, and how to decrease the bytecode size of your applets and applications.
Objective Blend is a package of user interface components that OG/J utilizes. The Objective Blend package is included in OG/J as a runtime package; you can build your OG/J package with this package. It comes as a single .zip file which is included in the lib directory.
Objective Grid enables even the novice programmer to create full-featured spread-sheet applications. The majority of the functionality of Objective Grid is automatically provided directly by the package. Programmers who wish further customization can create classes from the base classes provided and extend their functionality even more. This is the type of functionality that programmers consume hours developing and even more hours debugging. Products like Objective Grid can enable an average programmer to turn out above average applets and applications. I'd rate this product as a must-have for serious programmers.
About the Author
Edward Zebrowski is a technical writer based in the Orlando, FL area. Ed runs his own Web development company, ZebraWeb, and can be reached on the net at [email protected]