I am extremely pleased today to announce the availability of release candidate for version 5.0 of Substance look-and-feel. The roadmap for this release has been published in April, and the library has undergone significant internal and external changes to address major performance issues and to ensure the long-term code health of the project.

The release notes for version 5.0 provide detailed information on the major application-facing changes in this version. Some of the applications that have used Substance-specific APIs and client properties or defined a custom skin will have to be modified when upgrading to version 5.0. This was absolutely mandatory to address the performance issues and ensure that the library stays maintainable in the long run. The code has grown a lot of unnecessary complications over the last few releases and had to be significantly refactored to bring it back to a clean and maintainable state.

Here is the list of big changes in Substance 5.0:

  • Moving to Java 6 as the minimum runtime requirement.
  • Addressing the performance issues. While the first announced drop was 20% faster than release 4.3, the release candidate is 3.5 times faster on static scenarios and 2.7 times faster on dynamic scenarios as measured by the LightBeam testbed.
  • New client property to allow using per-window skins.
  • Enhanced theming layer.
  • Removed 16 VM flags and left only 2.
  • Removed 15 client properties, consolidated 3 others into 2 and added 1 new.
  • Removed 54 API methods on the main class, pushing some functionality into the theming layer.
  • Consolidated theme pack, watermark pack and button shaper pack into the Extras pack that also provides additional skins.

Click on the button below to launch a signed WebStart application that shows the available Substance features.

The following sub-projects are also available as release candidates:

As promised, version 4.3 (the last version that can run on Java 5) is in long-term support mode. At the present moment this version has thirteen bug fixes backported to it from the main development trunk.

You are more than welcome to take Substance 5.0RC for a ride and report any problems in the project mailing lists, forums or issue tracker. The final release is scheduled for September 15. Only bugs will be fixed until that date.

Sample screenshots of Substance in action:

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

  • Jacek Furmankiewicz writes about release 0.2 of SwingBuilder project that allows declarative UI binding via a YAML file. The project aims to address many of Swing’s pain points, such as verbosity, event listeners, layout management, data binding, background long running tasks, internationalization and more.
  • Looks like the Eclipse Albireo project that promised easy embedding of Swing components in SWT applications is losing some steam. According to Gordon Hirsch‘s post on the dev mailing list, both active developers (Gordon himself and Bruno Haible) are being reassigned a th their jobs, making it problematic to devote much time to bringing Albireo to beta and release status. With no community participation in development, looks like the project is heading towards stagnation.
  • Geertjan Wielenga overviews four of the available Java desktop frameworks (missing a couple of others in the process), giving some general advice on choosing the right framework for your project. A sound collection of tips which can be extended to pretty much any other programming field.
  • Geertjan is playing with the Swing Explorer project (by Maxim Zakharenkov) and explores its NetBeans integration. A noteable feature is jumping from the painting stack trace back into the NB source editor for the matching method.
  • Jasper Potts continues his series on customizing Nimbus appearance. He has posted a useful program that lists all Nimbus-specific UIManager entries, along with the graphics representation of the matching values (painters, borders, insets, colors, fonts). It gives a great visual overview of the entries that can be customized, even if a few rows show weird visuals (such as RadioButtonMenuItem[Disabled+Selected].checkIconPainter).
  • Christopher Deckers has announced release 0.9.6 of DJ Native Swing project that aims to bring native components, such as web browser, Flash player, video player or HTML editor into Swing applications. This release provides better integration logic with foreign native components.
  • Having problems skinning custom Swing components under the Swing system look-and-feel? SWT 3.5 might have an answer for you. One of the items for SWT 3.5 is to “provide an API to draw operating system themed controls and parts of controls”. As i have shown with native text rasterization, you don’t need to wait for Swing to provide the missing functionality (although it is most certainly nice when they do so).
  • And finally, Christophe Le Besnerais has the second part of his quest to create a modern-looking UI application in Swing, talking about breadcrumb bar, glowing icons and custom-shaped frames.

The demo applications for the Flamingo JRibbon component make heavy use of the SVG icons to make sure that the icons can be scaled without losing visual details. While Flamingo provides Batik-based implementation of the ResizableIcon interface, this has proven to place a noticeable burden on CPU during the application startup phase. One of the ways to address this performance issue is to use the SVG-Java2D transcoder that is part of Flamingo core distribution.

There’s nothing like eating your own dog food, and while trying to use the transcoded Java2D class to replace the runtime SVG decoding i found that it was lacking some of the basic functionality. The most glaring one was lack of API to query the default bounds of the SVG image. This is now exposed in the Java2D class with two static methods – getOrigWidth and getOrigHeight.

The second enhancement to the org.jvnet.flamingo.svg.SvgTranscoder class is the new setJavaToImplementResizableIconInterface(boolean) method. If you call this method prior to calling the transcode(), the resulting class will implement the org.jvnet.flamingo.common.icon.ResizableIcon interface, making it ready to be used instead of the org.jvnet.flamingo.svg.SvgBatikResizableIcon class. This comes handy since the heavy transcoding is done offline, and the size of the compiled class is comparable with the size of the compressed SVG file (especially if you turn the debugging info off). You can see the difference yourself by running the ribbon demo below – once the application frame is shown, all the icons are immediately visible and you can start interacting with it.

To change the package name of the generated Java2D class, call the setJavaPackageName(String) method prior to transcode() call. The last addition is the sample test.svg.SvgBatchConverter class that shows how to run the SVG-Java2D conversion in batch mode on all SVG files in a given folder.

Using the offline transcoding has another advantage – you don’t need to bundle the Batik jars that are around 3-4MB heavy. One point left to your consideration is the issue of the license of the original SVG images and its implications on the transcoded Java2D classes.

The last entry on Flamingo component suite talked about addition of contextual task groups, dynamic changes to in-ribbon galleries and reworked documentation. Over the past couple of weeks i have been working on the ribbon application title bar and formulating the future plans for the component itself.

The application title bar is a ribbon-specific feature that allows putting extra ribbon content on the title pane of the frame. In Office 2007 the application title bar contains the quick access toolbar and the headers of contextual task groups. Flamingo’s counterpart of quick access toolbar is the taskbar and up until now it has been placed to the left of the task toggle buttons. In addition, the contextual task group headers were not shown at all.

Putting content on the title pane requires close cooperation with the look-and-feel implementation, and as such is only available under Substance look-and-feel (interested developers are welcome to take a look at the code to see how this can be extended to other third-party LAFs that support decorated mode). Here are a few screenshots that show the new functionality in action.

The first screenshot shows the ribbon component with the taskbar automatically placed on the left hand side of the title pane. The taskbar has a few command buttons, one of them with a popup menu (click for the full size view):

The next screenshot shows the ribbon component with two visible contextual task groups. Note how the group headers are painted on the title pane and force the title text to be clipped:

The last screenshot shows the same component with one of the contextual tasks selected:

Here is what you need to use this functionality in your application:

The last point brings me to the future plans for the ribbon component. This is still work in progress that is targetting the next release (4.0), but you can already try it under the latest 3.1dev branch. The JRibbonFrame is going to be the only way to have a ribbon in your frame. It extends the JFrame and enforces that a JRibbon component is always in the BorderLayout.NORTH position. Under the hood, it also allows third-party look-and-feels (such as Substance) to “relocate” the taskbar to the title pane and paint the contextual task group headers. Going forward, the JRibbon class will have package-protected constructor. This will be part of 4.0 release to ensure easier transition to the new approach.

The plans for release 4.0 include providing the missing functionality from the Office 2007 Command Bar, including:

  • Application title bar for other look-and-feels. The taskbar and contextual task group headers will be placed there (except when the application is running under Substance or other look-and-feels that will provide support for placing them on the frame title pane).
  • Main application menu button.
  • Pluggable resizability policies.
  • Minimizing the ribbon.
  • Horizontal scrolling for content under small widths.
  • Better support for placing core controls and button groups in ribbon bands.
  • Key tips.
  • Screen tips (AKA rich tooltips).

To try the new title bar functionality in action, click the WebStart button below and use the “Group” checkboxes in the bottom control panel to show / hide the contextual task groups.

икони