Tonight's presentation at the St. Louis JUG is by Kyle Cordes, principal of Oasis Digital, and his title is Direct Manipulation User Interfaces with Java Swing.
This is once again one of those talks that you have to attend to appreciate its content. Reading the slides afterwards probably won't do it.
Before the talk Raj Patel asked what the talk is going to be about. The answer I came up with is "writing a Swing application where the users don't enter texts and push buttons." At the opening of the presentation, Kyle also pointed out that he's not talking about Swing drag-and-drop, which is all about negotiating data formats. Nor is he talking about Naked Objects, whcih is all about not writing the GUI.
Kyle spent most of the time in Eclipse, doing demos while going through source code class by class and line by line.
Kyle's thesis is that direct manipulation user interfaces, based on drag-and-droppable on-screen widgets, can provide fast, efficient, intuitive, and appealing data manipulation in your application.
In one of the demos, the screen is populated with small JPanels in a ten row three column grid. You pick up one and move it to a different spot. As you are dragging the JPanel other JPanels make way for it by moving to a different location in an animated fashion. "Wow" was my first reaction.
Then he went through the code. And the code was amazingly simple. It uses Swing features to the fullest extent, but simple. The animation logic is driven by a Swing Timer whose action is simply: hey, each JPanel, check if you should move to a different spot, and if so, move a little bit toward the new spot. The fancy animation is an emerging behavior out of this simple logic. Another "wow" at the source level.
After the talk I asked if he wrote any tests for the code. The answer is no. "How could you write a test for the emerging behavior?" Jeff Grigg put it a different way: "How could you write a test for 'this is fun?' You let the user use it and watch them having fun!"