THE
GREAT IDE ROUNDUP
Visual
Cafe 3.0 Features Swing
By Mark Andrews
Improved
support for Swing is one of the most important new features in Visual
Cafe 3.0 for Java, the newest version of Symantec's best-selling
integrated development environment (IDE) for the JavaTM
programming language.
Visual Cafe -- billed as the best-selling IDE for three years running
in the world of Java programming -- now features "full support
for Swing," Symantec proclaims. One important new feature of
Visual Cafe 3.0 is a new point-and-click menu designer that makes
it easy to create and edit menus in Swing-based programs.
Visual Cafe 3.0 also boasts new support for JDK 1.1.7a and JDK
1.2 (although you must download JDK 1.2 from the Java
Software Web site if you want to use Visual Cafe to develop
JDK 1.2 applications).
New Features in Visual Cafe 3.0
Other new features of Visual Cafe 3.0 include:
- The newest version of Symantec's lightning-fast Just-in-Time
(JIT) compiler, which Sun Microsystem, Inc., has been included
with the official Java programming language JDK since the release
of JDK 1.1.7.
- New Wizards that simplify the creation and management of actions,
methods, properties, arguments, and strings associated with the
interactions that take place in your Java programs.
- A new Javadoc editor that lets you create and edit Javadoc comments
for your programs without leaving the Visual Cafe develpment environment.
- A new set of tools that make it easier to add JavaBeans to your
component library, and to edit and update Beans so they can be
used in multiple projects.
A Tradition Continues
Visual Cafe 3.0, like previous versions of Symantec's IDE,
offers a generous supply of integrated tools for developing applets
and applications in the Java programming language, including a project
manager, a form designer, a component library, a code editor, a
class browser, an interaction wizard, and an integrated graphical
debugger, coupled with Symantec's acclaimed JIT (just-in-time) Java
compiler and an an applet viewer.
Of the full-featured IDEs that we have tried out for this series
of articles, Visual Cafe is still the IDE productd that has the
largest numbers of automated features built in. "For many tasks,
you don't have to work with raw source code at all" when you use
Visual Cafe for Java, Symantec declares.
Our own experiences with Visual Cafe tended to back up that claim.
Of the four IDEs that we examined for this Special Report, Visual
Cafe really was the only one that enabled us to create a working
Swing applet that did what we wanted it to do without having to
add any handwritten code.
Visual Cafe's Three Editions
If you're familiar
with Visual Cafe for Java, you know that it has always been available
in in three editions -- and it still is.
- A Professional Development Edition designed for the development
of large, sophisticated Java applications. This edition features
a pair of high-speed compilers that can convert source code written
in the Java programming language either to native x86 code or
universal class files.
- A
Java Database Development Edition, which adds database
connectivity to all the features of the Professional Development
Edition to an array of flexible database technology. Features
of this edition include data-aware JavaBeans that can interface
with your program's data via JDBC or an included dbANYWHERE Server.
- A Web Development Edition, which is designed to put Visual
Cafe development within your reach of any program. This bargain
edition of Java Cafe includes templates, JavaBeans, Wizards
and drag-and-drop Java and HTML visual environments.
All three editions of Visual Cafe 3.0 offer new features and capabilities.
The new Database edition of Visual Cafe offers a host of improvements,
including seamless data binding to Swing components. New features
in the Professional edition include new Wizard-base support for
servlets, a new localizatoin tool, and new version control mechanism,
and an improved customizable user interface.
For more details about the new features of all three editions of
Visual Cafe 3.0, visit the Visual Cafe section of the Symantec
Web site.
Support for Swing in Visual Cafe
The previous release
of Visual Cafe for Java -- Version 2.5 -- was updated from earlier
versions to include basic support for Swing. And Version 3.0, released
shortly before the January issue of The Swing Connection went online,
offers even more support for Swing.
Visual Cafe's Swing support is quite visible; its component palette
displays a generous collection of Swing components, which has been
expanded with the release of Visual Cafe 3.0. Here's a screen shot
of some of the components that appear on the Visual Cafe's Swing
palette:
How we tested Visual Cafe
The
articles in this section are not formal reviews; they merely report
the general impressions that we gather as we try out various IDEs.
When you try out an IDE that we have reported on, you may agree
or disagree with our conclusions. Different developers like different
kinds of development environments, and your personal evaluation
of a particular IDE is entirely up to you.
To get an idea of what kind of Swing support
is built into Visual Cafe 3.0, we put the product through a simple
but rather demanding test. It's the same test that we have used
to evaluate all the IDEs covered in
this series of articles.
To conduct the test, we
create a small animated applet with the IDE that we're evaluating.
And as we design and test this applet, we keep two questions in
mind. First, we evaluate how easy it is to design and develop the
applet that we're building. Second, we see how close we can come
to building an applet that looks and behaves just like a similar
applet created from scratch, without the help of any IDE.
The applet that we try to duplicate in this
test looks like the one shown below. You can see how the original
test applet works, and even experiment with its source code if you
like, by downloading its code from the
"Getting
Started with Swing"
article in the "What Is Swing?" section of this issue.
When you run the applet, you see Duke, the Java Software mascot,
sitting in a Swing.
Below Duke's picture, there's a toggle button that says, "Swing!"
Click
the button, and Duke starts swinging. Click it again, and he stops.
The animation that the applet uses is the ultimate in simplicity.
To make Duke start and stop swinging, it merely toggles back and
forth between two GIF files: one that's animated, and one that isn't.
Despite
the applet's simplicity, though, it puts the IDEs featured in this
roundup through some fairly demanding paces.
First,
the Swinging Duke applets tests to see whether the IDE you're working
with can even create a standalone applet that works as it should.
(When we first started trying out IDEs for this series, there were
some IDEs that couldn't do that). It also reveals whether the IDE
being evaluated supports toggle buttons (most don't), and it shows
how easy (or difficult) it is to display and manage image files
using the IDE that's being evaluated.
Testing Visual Cafe's Swing support
In our original Swinging-Duke
applet, we used an object of the ImageIcon class to create Duke's
picture on the screen. The Visual Cafe 2.5 component palette doesn't
contain an icon representing the ImageIcon class (nor did any of
the other IDEs we have tried out to date in The Great IDE Roundup.)
To build the applet using Visual Cafe, we substituted a proprietary
component called called a "SlideShow" component for the Image Icon
component we had been looking for.
That turned out to be a good choice, because Visual Cafe's SlideShow
component has animation capabilities that we were able to put to
good use. Its animation capabilities helped us toggle back and forth
between the animated GIF file and the still-shot GIF file that provides
the Swinging-Duke applet with its "start swinging" and "stop swinging"
action.
Speaking of toggling, we were surprised to see that the Visual
Cafe component palette does contain an icon representing
Swing's toggle-button class. When we examined the component's property
page, it offered no easy way to equip a toggle-button object with
images showing it in both its enabled state and its disabled state.
We could have written code to do that, but our object was to build
our applet using as little handwritten code as possible. So we decided
to go to the Swing page of the component palette and get a pair
of regular JButton objects instead. We placed those on our design
form, which now looked like this:
Adding some events
Visual Cafe uses
an interesting mechanism for adding event listeners to an application.
You click on an event-listener icon in the Visual Cafe toolbar,
and then you use the mouse to draw a line from one object on your
design form to another. When the line is complete, Visual Cafe displays
a browser window that lets you design the kind of event listener
you want to create, without having to write any code whatsoever.
When you need to add event-handling code to an application using
Visual Cafe, all you have to do is click a few controls in a cleverly
designed browser.
Once you get a feeling for how this process works, it's a fairly
easy mechanism to master. To make our little applet work, all we
had to do was draw a couple of lines from the two buttons at the
bottom of the applet to the picture just above them, and then draw
a couple of more lines from the picture to the two buttons. While
we were doing that, we defined our events more precisely using Visual
Cafe's event browser. Finally, we compiled our program, which wound
up displaying a panel that looked like this:
The result: Without writing any code at all by hand, we would up
with an applet that did precisely what we wanted it to do. When
we clicked the button labeled ">," Duke started swinging. When
we clicked the button labeled "<," he stopped.
Our applet even enabled and disabled the buttons that it displayed
in an appropriate manner. As long as Duke was sitting still, the
"<" button was disabled, so the only thing you could do was click
the ">" button to make him start swinging. Conversely, when Duke
started swinging, the ">" button was disabled, so the only thing
you could do was click the "<" button to make him stop.
Results of our tests
Some IDEs can automatically
generate all the code that a small application requires. Others
require you to write quite a bit of code yourself. The majority
fall somewhere in the middle.
We didn't test Visual Cafe using a large collection of large and
small applications -- we tested it using only the small "Swinging
Duke" applet that we've been discussing. But the limited amount
of testing that we did was enough to demonstrate quite clearly that
Visual Cafe is one of the more highly automated products that you're
likely to run across in your quest for the perfect Swing-friendly
IDE.
In fact, among the four products that we tested for this issue,
the only one that allowed us to create our Swinging-Duke applet
without writing any code was Visual Cafe for Java.
In a nutshell, we found it was very easy to created a fully Swing-compatible
"Swinging Duke" applet using Visual Cafe for Java. We didn't try
to build any large, complex programs with Visual Cafe, but we can
highly recommend it to programmers who want to create small applications
quickly and almost effortlessly, without having to write much code
by hand.
|