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

  • Daniel Spiewak walks through the steps of creating a simple form, from sketching the design on a piece of paper to implementing it in code. Personally, i felt that the recommendation to select the layout that the specific developer feels comfortable with is not very good for long-term maintainability, and the team would be much better off with a solid and well-known third-party layout manager such as FormLayout. Not to mention that the resolution independence is a very important topic which should not be dismissed lightly.
  • Wim Deblauwe writes about the intricacies of providing responsive UIs with SwingWorker, using a very basic and common scenario of wiring a progress listener to a long background task.
  • On a related subject, Carl from Palantir dives into the SwingUtilities.invokeAndWait and its behavior in thread interruption scenarios.
  • Thierry Lefort continues his explorations of table-based data visualisation techniques, using the JXTable component from SwingX component suite to provide filtering and highlighting capabilities. The second part uses a color utilities class to provide distinctive highlighting on selected cells.
  • Tim Dalton posts an update on the progress of his SQUIB project that provides Scala bindings for Swing components. Reading the code examples on his efforts in Scala and the parallel efforts in Groovy i can’t help but think it is still not much more than syntactic sugar. Indeed, you save a few constructs here and there (which is not necessarily a good thing, at least in the short run). I’m not really sure what am i expecting, but i’m definitely lacking a “wow” factor, so to speak. Something that would make me want to switch to Groovy or Scala for my hobby dabblings in UI technologies.
  • Jan Erik Paulsen has a teaser on the new application that he is working on in Teppefall Labs. Called Teppefall Capture, it allows capturing pictures and videos from an attached (web) camera. He rightfully mentions the abysmal state of affairs with respect to anything remotely related to video, and hopefully this situation will be addressed this year. My number one Java desktop wish for 2008 – where art thou?
  • Chet Haase has announced that he left the Swing-land to work on Flex SDK. Personally, i wish him nothing but the best, and hope that he will have the same level of passion once the initial excitement over the new technology wears out.

New painter types in Substance

February 20th, 2008

About three months ago i wrote an overview of painters in Substance look-and-feel. Painters are one of the major building blocks of Substance, and over the last few releases they have been used extensively to provide consistent appearance to both core and third-party components. Unfortunately, the original painter design and responsibilities have not always stood the test of time, and one of the painters has grown significantly beyond its API. This has made the code more complicated, cryptic and in some cases, a pain to maintain. It applied not only to the internal code, but also to the external painter users (as outlined in the skinner primer).

Specifically, i am talking about title / header painters. Originally, the title painters were responsible for painting title panes of top-level windows (frames, dialogs), internal frames and desktop icons. Over the last few releases, they have evolved significantly to allow custom painting of other UI areas, such as menu bars, tool bars, task pane containers, status bars and others. As additional capabilities were added to the title painter API and implementation classes, it became clear that these no longer reflect the true usage – decoration painting. To this end, let me first introduce the new concept in Substance – decoration area type:

The <font color="darkblue">org.jvnet.substance.painter.decoration.DecorationAreaType </font>enum provides enumeration of available decoration area types. As a picture is worth a thousand words, the following screenshots illustrate the different decoration area types.

The following screenshot is the main Substance test application under the Business Black Steel skin (click to see full size version):

The next screenshot shows the title decoration area, which in this example includes the title pane of the main window:

The next screenshot shows the header decoration area, which in this example includes the menu bar of the main window:

The next screenshot shows the toolbar decoration area, which in this example includes the tool bar of the main window:

The next screenshot shows the general decoration area, which in this example includes the task pane container and status bar components from the SwingX suite:

Let’s go back to the original screenshot:

It illustrates that the specific skin assigns different color schemes to different decoration areas. The controls in those areas get the background and foreground colors based on their assigned color scheme (without any custom application code), thus creating visual distinction between different application areas.

In addition to the decoration painter, the latest development drop of version 4.3 (code-named Nairobi) introduces the new highlight painter API. The highlight painter is used to paint rollover and selection highlights on tables, trees, lists and menu items. In addition, it is used to paint highlights on third-party components, such as task pane container and month view in the SwingX suite.

For more information, please consult the following documentation:

If you switch to the latest 4.3dev binary drops, you might experience a few minor visual glitches. These will be addressed during the development cycle, but don’t hesitate to drop a mail or post a forum message if you find a regression. Also, if you were using the old title / header painter APIs or were providing a custom title / header painter in your application – first, apologies for breaking the binary compatibility, and second, i am here to help migrating your old code to the new painters.

Flamingo 3.0 official release

February 19th, 2008

It gives me great pleasure to announce the official release for version 3.0 of Flamingo component suite (code-named Deirdre). The goal of this project is to provide a small and cohesive set of powerful UI components that allow creating modern applications that provide visual functionality similar to or superseding that of Vista Explorer and Office 2007. The components provide consistent visuals under the existing core and third-party look-and-feels, respect the DPI settings of the user desktop and follow the core Swing guidelines in the external APIs and the internal implementation details.The component suite includes:

The project is licensed under BSD license and requires JDK 6.0. You can see the demo applications here. The binary and source bits are available here. A few screenshots of some of the Flamingo components:

File-selector breadcrumb bar and file viewer panel with medium command buttons:

Ribbon under Windows XP look-and-feel with resizable SVG-based icons:

Ribbon under Synthetica Mauve Metallic look-and-feel:

SVN-selector breadcrumb bar and file viewer with tile command buttons and SVG based icons:

Command button with a command button panel embedded in a popup panel:

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

  • Thierry Lefort joins the ranks of Swing bloggers and opens his blog with a slew of posts. The first entry talks about rendering bar charts in table renderers, the second one adds zooming capabilities to tables (with a very interesting zooming on selection mode) and the third one shows how to use Swing worker in a modal cancellable dialog.
  • Geertjan Wielenga has a three-part introduction series to Beans Binding. Part 1, part 2 and part 3 walk through the various parts of the Beans Binding project.
  • Chet Haase has posted a video for his QCon 2007 talk. While there is nothing new there (it has been held last November), you might still be interested in a general overview of what is scheduled for 6.0 update N and 7.0.
  • Joshua Marinacci seems to confirm my guess on exporting Adobe artwork into JavaFX and SceneGraph formats. Here is what he says in the comments on a non-directly related blog entry: [h]owever, at JavaOne we will show you how to easily pull graphics created by designers using traditional design tools into your JavaFX applications
  • Alexander Potochkin reports on providing more support for JPopupMenus on system tray. Based on the comments on this entry, and on earlier entry by Artem Ananiev, this is another sore point for desktop-integrated Swing applications.
  • Finally, it looks like the next build (12) of 6.0 update N will have significant new functionality for Swing developers. In addition to a few performance-related issues on the new Direct3D pipeline, two new enhancements that i’ve talked about earlier have been marked as fixed for 6.0u10-b12: 6656651 for native text rasterization, and 6655001 for window translucency. Now this is definitely worth the wait.