Filthy Rich Clients 2

Posted by Rich Apodaca Tue, 29 Jan 2008 18:52:00 GMT

If you wind the clock back enough years, the world of graphical user interfaces was ruled by standardized look-and-feel specifications. This approach was taken in an effort to centralize all of the GUI coding in applications, make it easy to document the application (everyone knows what a slider does, therefore it doesn't need to be described), and work around the relatively poor graphics performance of desktop computers.

But the last decade's collision between the computer industry and the consumer has led to a huge increase in the emphasis on aesthetics in user interfaces: for everything from brand awareness to increasing the comprehensibility of sophisticated systems, to eye-catching coolness to draw the customer in, to just plain "Wow!" ... Aesthetics are in.

-James Gosling, Forward to Filthy Rich Clients

The "destandardization" of the GUI has been underway for several years. From Web applications like Picnik to Flash video players to Apple's iTunes application, users are getting increasingly used to the idea that not every program needs to look like Microsoft Office, and that some of them never should have in the first place.

Now, it's possible to infuse Java Swing applications with the look and feel of this new breed of GUI. The new book Filthy Rich Clients shows how. Covering topics ranging from threading to animation to compositing, this well-written book is a goldmine for anyone wanting to break out of a GUI rut.

The use of reflections, animation, fading and the like in serious applications may seem frivolous. But used in the proper context, these effects can add a great deal to usability and appeal.

Today's frivolous use of memory and CPU cycles has a strange way of becoming next year's must-have feature.

Swing Sightings: LigandScout

Posted by Rich Apodaca Thu, 24 Jan 2008 13:23:00 GMT

Source: LigandScout

Swing Sightings: Chenomx NMR Suite

Posted by Rich Apodaca Wed, 16 Jan 2008 14:43:00 GMT

Building a Molecule Preview with Firefly: The Joy of Swing

Posted by Rich Apodaca Wed, 18 Jul 2007 10:52:00 GMT

Previous articles have discussed Firefly, the codename for a new 2D structure editor for the Web. Although it can be deployed as a self-contained applet on Web pages, Firefly is composed of modules that are readily re-used. By taking advantage of this design and Java's native UI toolkit Swing, new UI elements can be built with relatively little effort. This article outlines one such use - the creation of a file dialog that contains a molecule preview.

Many image processing applications such as Photoshop or GIMP provide an image preview that appears in file browser dialogs. Wouldn't it be nice if applications that process molecular structure files came with a similar feature? The screenshot below shows a file chooser with an embedded molecule preview based of Firefly's Painter component:

When a new molfile is highlighted, a new preview is automatically generated:

The molecule preview is capable of all of the customizations available in Firefly including background, bond, and atom colors, borders, and atom label fonts. No matter how large or small the molecule, and regardless of its starting coordinates, it will always be exactly scaled to fit the available space and precisely centered.

This dialog was rapidly implemented using the accessory capability provided by Swing's JFileChooser:

JFileChooser chooser = new JFileChooser();
PreviewAccessory accessory = new PreviewAccessory(chooser);

accessory.setPreferredSize(new Dimension(150, 150));

chooser.setAccessory(accessory);
chooser.addPropertyChangeListener(accessory);

// ...

Defining a JComponent implmenting the PropertyChangeListener interface is all that's needed to get a working molecule preview:

class PreviewAccessory extends DefaultPainter implements PropertyChangeListener
{
  // implementation
}

Swing has come a long way since the dark days of JDK 1.2. What started out as the dog-slow ugly duckling of user interface toolkits has developed into one of the best platforms for building desktop applications out there. Advanced tools such as the WYSIWYG interface builder Matisse and the polished components offered by JIDE make Swing an even more attractive option. The example described here is just one instance of how Swing's well-conceived design simplifies the job of building rich user interfaces.