Over the past releases of Substance look and feel I found that it helps to have a well-defined release lifecycle and schedule. The usual cycle for a minor release is 12 weeks long, with last two weeks being the release candidate stage and the two weeks before that (a month before the final release) being feature freeze. For the upcoming version 4.1 (code-named Lima) which is scheduled to be released on November 12th, the feature freeze is this Sunday. There are a few new features, most of them coming from the users. In this post, i’m going to talk about two of these.

The first is the reworked visual appearance of tabbed pane content border and a client property to control it in the application code. Here is how this border looked like in the previous release under Business Black Steel skin:

Here is how it looks like in the new release (the gaps between the checkboxes and radio buttons have been artificially tweaked to have the content fit on the frame):

The main difference is in the top portion of the content pane border. By default, it now follows the modern appearance of such applications as Firefox and Internet Explorer 7, and look-and-feels such as Nimbus and Quaqua (which follows Mac Aqua).

Here is another “old” screenshot of Creme skin:

And here is how it looks now:

The last couple of “before” and “after” come from the Autumn skin. The “before”:

and the “after”:

While this brings more modern look to the tabbed panes, some application may require additional control over the content pane border. This is what the new TABBED_PANE_CONTENT_BORDER_KIND client property is for. The default value is TabContentPaneBorderKind.DOUBLE_FULL which is what the next screenshot (and the screenshots above) show:

In order to use the old painting, use the TabContentPaneBorderKind.SINGLE_FULL value:

If you have nested tabbed panes, you can use either TabContentPaneBorderKind.DOUBLE_PLACEMENT value:

or the TabContentPaneBorderKind.SINGLE_PLACEMENT value:

Thanks to Luke Sleeman for opening an enhancement request that prompted this functionality.

The second feature is the reworked support for lock icons on non-editable text fields and editable comboboxes with model-only auto-completion. Up until now, Substance added a lock icon in the bottom left corner of such components unless you used the NO_EXTRA_ELEMENTS property, which is kind of an overkill for this. The latest 4.1dev drop of Substance (which bundles the latest 3.2dev drop of Laf-Widget) adds a new LafWidget.NO_LOCK_ICON client property that allows controlling the presence of lock icon for a specific component.

In addition, Kamil Paral has requested a very useful enhancement: when you wrap a non-editable text area in a scroll pane, the icon only appears when you scroll all the way down. And so, in this case, the latest drop paints the lock icon just above the horizontal scroll bar. You can read about the implementation limitations in the enhancement report, but i’ll sum up two shortcomings:

  • If you scroll horizontally, the icon will disappear – it is bound to the left border of the wrapped component.
  • The scroll mode is switched from BLIT to SIMPLE which might affect the scrolling performance.

If these shortcomings make this feature undesirable, use the NO_LOCK_ICON on that specific component and set it to Boolean.FALSE.

Those of you who came to the session (PDF link) that Alex and I have presented at JavaOne 2006 saw the application that we wrote to illustrate different animation, translucency and transition techniques. The project itself was named Rainbow and all the bits were made available immediately after the session. Unlike many other demo applications written specifically for JavaOne, Rainbow was not meant to be one-shot sow-it-all-together-over-the-pizza to be left stagnating in the dark, and over the past month i have added a few big features.

There are two main new features that you can find in the version 1.1 (nearing RC stage), code-named Nightstone:

  • Support for SVGZ format in addition to SVG
  • Ability to browse local and remote SVN repositories with the new breadcrumb bar functionality from Flamingo.

To try the latest dev version in action, click on the WebStart button below:

After the application has been downloaded (it is about 12MB large, including the bundled Batik, Substance, SVNKit and a few others) and granted permissions (as before, you can convert the SVG images to Java2D code classes and PNG images and save them to local disk), you can browse two remote SVN repositories, Oxygen and Kalzium.

Here is a screenshot that shows a few icons from the Oxygen SVN repository (click for full view):

As you can see, the application is able to show compressed SVG images (in SVGZ format) after these have been downloaded from a remote SVN repository. Here is a screenshot of another Oxygen folder:

As before, when you click on an icon button, you will see another frame pop up with three tabs. The first tab will show you the SVG contents (XML), the second tab will show you the matching Java2D code that you can save as a local class, and the third tab will allow you to apply a few effects on the SVG image and save it as a local PNG file. For example, if you’re interested in more details on the new Konqueror icon, here is what you’ll see:

Want to see it inverted? Click on the “Invert colors” checkbox et voila:

Still convinced that web applications are the way of the future?

Here are some Swing links that you might have missed during this week:

  • “Fling Scroller” article on java.net by Jan Haderka. Shows how easy it is to implement motion-based scrolling in lists with Timing Framework and a little bit of math. The comments show a similar approach that works on any scroll pane.
  • The new Expression Layout manager by J. Stephen Kress. While the simple example is less readable at the first glance than FormLayout, time will tell if this approach is adopted by the individual developers and the tooling community. My advice to both this project and MigLayout – work with NetBeans, JFormDesigner and Instantiations to provide tooling support, either as the core functionality or third-party plugin.
  • Milestone 1 of Bean Properties by Shai Almog is out. The timing is a little unfortunate and Beans Binding (JSR 295) seems to be getting all the attention, but the time you spend on reading the examples will not be spent in vain. It also has examples on integration with SwingX, Echo2 and Spring.

Following the comments from the previous entry that introduced a Swing breadcrumb bar component that allows browsing local and remote SVN repositories, the latest 2.1dev drop of Flamingo has the following new features:

  • Kamil and Danno pointed out that the network-related tasks (such as connecting to an SVN repository and fetching folder contents) shouldn’t be done on the EDT. I guess this is what happens when one pays too much attention to pushing the pixels :) The latest drop uses the JDK 5.0-compliant version of SwingWorker and offloads all relevant tasks off the EDT. The end result is that all breadcrumb bar core implementations (including the local file system browser) should be much more responsive and without any UI freezes.
  • AC suggested that i should provide an adapter to TreeModel interface. The org.jvnet.flamingo.bcb.core.BreadcrumbTreeAdapterSelector does just that, allowing wrapping an existing JTree or TreeModel with minimal additional application logic. The only additional logic you need to provide stems from my current reluctance to rely on the existing tree cell renderers, especially when a custom renderer doesn’t extend a JLabel. There are three constructors in this class, and you can look at test.bcb.JTreeAdapterBreadCrumbTest and test.bcb.TreeModelAdapterBreadCrumbTest to see how easy it is to wrap and adapt an existing tree or tree model.
  • Eugene was confused by the proximity of the SVN repository selection combobox and the breadcrumb bar itself in the screenshots. This prompted me to write an experimental org.jvnet.flamingo.bcb.core.BreadcrumbMultiSvnSelector class. Its root selector allows selecting an SVN repository, and all the other selectors browse through the selected repository. There have been some synchronization issues, since everything is done off EDT in separate SwingWorker tasks; these have been hopefully addressed. You can play with this component or the test.bcb.MultiSvnBreadCrumbTest test application and let me know if you run in some deadlocks / synchronization / inconsistency issues.

Thanks to everybody for your insightful comments. Hope you like the new version better. Here is the link to the WebStart SVN browser application once again (this time without hogging EDT):

For more thoughts from the original creator of Swing breadcrumb bar, Rick Jelliffe, click here.

Update based on the comments: the latest version of Flamingo has the following fixes

  1. Immediately showing selected element with ellipses (…) to indicate that the choices are loading
  2. Not showing the choices selector when there are no choices
  3. Fix on pressing the choices selector arrow when popup is showing

Thanks, Eugene and Matt for valuable feedback; it is much appreciated. You’re welcome to run the WebStart application and see if it behaves in a more user-friendly way.