o the future by using Cosmo Code today. I did, and I liked what I saw; Cosmo code is as good a Java integrated development environment (IDE) as I've seen.
Currently, Cosmo Code ($495) is available only for SGI workstations running Irix, but a Windows version should be released by the end of the year. All the elements of the Cosmo Code main window exist in other Java IDEs in one form or another. At the top are the menu and toolbar, just below is a pane for displaying source code, and at the bottom is a tabbed collection of panes called the "card panel."
The source-display pane also shows status information, such as compiler-error or warning messages. During a debugging session, just above this pane appears the thread bar. This is a series of tabs bearing the names of threads existing in the program. C
olored indicator lights and icons affixed to each tab reveal the state of each thread, such as currently running, suspended, or dead.
The card panel provides different views into an application during development, execution, or debugging. You select which view is active by clicking on the appropriate tab, which brings the associated card to the top. These tabs are grouped into three broad categories-- development, debugging, and compile/execute.
For example, click on the project tab, and you're shown what amounts to a small file-manager window holding icons that represent the various files that make up your project. Click on the overview tab, and Cosmo Code shows you an inheritance diagram of the classes in the current project. During debugging, you can click on the call stack and follow the chain of methods calling methods as your program executes. Click on the data tab, and you can inspect the contents of variables, arrays, or even objects.
What makes the card panel useful (and permits it
to bear the name "card") is the fact that you can "tear" a card off the panel and place it anywhere on-screen. The torn-off card becomes an independent window. Consequently, you can have several cards active at once, each providing different views into your application. Therefore, during a debugging session, you can concurrently view the progress of your application through a callback card while watching the state of variables in a data card.
Building Visually
Like other visual IDEs, Cosmo Code's Visual Builder lets you construct the visual aspects of your applet with drag-and-drop ease. Once you've dropped a visual object onto your applet's panel, you can double-click on that object; Cosmo Code then opens an object-inspector dialog box through which you can alter the object's properties (text, background color, events supported, and so forth).
Once you have a panel populated with visual objects, the real programming task begins: associating events triggered by one object to resulting be
havior by another. I have always admired IBM's Visual Age products' approach, in which you "wire" together source and destination objects on-screen and then specify the characteristics of the interaction through IDE-guided dialog boxes. Cosmo Code's tack is similar. To program the causal relationship between, say, a button being clicked and a sidebar being cleared, you select the
wire tool
, click on the source button, and drag to the destination text box. This establishes the button as the source of the event, and the listbox as the respondent of the action. A dialog box pops up, in which you specify which event triggers the action as well as the method to be called on the receiving object.
Once you've done all this wire programming for the objects in an applet, Visual Builder lets you run the visual component portion of the application to verify that it functions as you meant it to. But this simulation goes only so far. You might, for example, want to code special behavior into yo
ur application that the Visual Builder does not support. In this case, Cosmo lets you resort to user-defined methods--those that you write by hand and that are called in response to whatever events with which you associate them. (For example, you may want the clicking of a button to perform some elaborate calculation.)
Since Visual Builder can't compile and execute Java code on the fly, it's unable to execute user-defined methods. But this is a small and understandable limitation.
Cosmo Code is able to handle the 1.0.2 event model as well as the newer delegated event model released with the JDK 1.1. As you wire objects together and select events, Cosmo Code's dialog boxes point out which events and methods are deprecated (in the 1.0.2 version). This dual support is for compatibility reasons: Even now many of the browsers at work on people's desktops are still not up to the JDK 1.1 standard. So, were Cosmo to emit 1.1 code only, that code would likely break at most client sites.
Where to Find
Silicon Graphics, Inc.
Mountain View, CA
Phone: 415-960-1980
Fax: 415-961-0595
Internet:
http://www.sgi.com