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

SWT, Eclipse 4 and custom skinning

September 21st, 2008

Are SWT and Eclipse moving away from native widgets? If you follow the development mailing lists of the relevant Eclipse subprojects, this might be one of the more interesting questions for Java UI developers.

Much has been said over the past few years about the relative merits of Swing and SWT. SWT has always prided itself on using native widgets (wherever possible), sporting better platform fidelity and performance. In the meantime, the competitive pressure from SWT has, in the view of many observers, made Sun invest much-needed attention in Swing. It zigzagged a little in its priorities regarding native look-and-feels; much work has been done in Mustang for Windows and GTK LAFs, but the few glaring remaining bugs have been ignored ever since. However, Swing, AWT and Java2D teams at Sun have been at work bringing significant performance improvements (and not only for hardware-accelerated pipelines), using native font rasterizer on Windows, support for translucent and shaped windows and more.

The flexibility and extensibility of Swing painting pipeline allows creating applications that bear little semblance to the dated Ocean look, and it looks like SWT might be moving in this direction as well. Lotus Software has been purchased by IBM back in 1996 for 3.5 billion dollars, and IBM has put a lot of resources to continue the development of different Lotus components (such as Domino and Notes). Unbeknownst to many (which is a good sign for any software in general), Lotus is an SWT application. It certainly doesn’t look one – click the screenshot for the full size view:

Not much information is available on custom Lotus SWT components (or i haven’t looked hard enough), but this presentation (zipped PowerPoint) provides some insights – the UI guidelines are implemented with CSS:

A majority of our CSS support was intended to give the custom Lotus SWT widgets as much flexibility as possible. Styling standard SWT widgets is supported but very limited (fonts, colors, background image).

Another interesting development comes in the form of Eclipse Riena which is currently in the incubation stage. While you might want to skip the buzzword soup in the project description (enterprise service oriented blah blah), Riena aims to bring a fresh look to Eclipse RCP applications. The presentations at Eclipse Summit (PDF) and Eclipse Forum Europe (PDF) show these designs (click for full size view):

And while the UI of the sample applications shipped with milestone 4 of Riena 1.0 is quite far from the design mockups above, the trends are quite clear – Eclipse / SWT based applications are trying to break away from the native look-and-feel. So what are the plans for core SWT layer?

The answer to this question might be found in the mailing lists of e4 project. e4 is the codename for the next major release of Eclipse (hence the number 4). There are a lot of interesting ideas bouncing around the lists, including using EMF for driving the UI definitions (aiming, perhaps, at the same level of design/development separation as available in WPF, Apollo and JavaFX) and targetting different runtime environments such as Web browsers. It appears that one of the fundamental shifts is going to be the support for CSS skinning for the UI components.

Kevin McGuire is a platform UI contributor working for IBM on Eclipse UI, and his views on Eclipse-based RCP applications are quite refreshing:

As I survey the Eclipse based applications, RCP or not, they all look, well, like Eclipse based applications. Eclipse provides much power through reuse of existing components and extension of frameworks. But my goal as an application developer is to build software that is as appropriate for my audience as possible. That audience could be anybody. However, many choices we made early on in Eclipse were with an IDE user in mind and just don’t work well for other user types.

Why should my choice of technology so blatantly drive the UI experience? I’d like all that reuse and power, thank you, but the end result shouldn’t betray the technology used to build it, provided I am willing to invest in specializing it.[…] I’d like to see as rich a set of graphical front ends for Eclipse. Certainly CSS helps by providing good separation of behaviour and UI, but the components must be designed to make use of this separation.

[…] Eclipse based applications should be capable of the same degree of visual and interaction sophistication as web based applications. This is essential for reaching a wider audience.

This point of view is also shared by Christian Campo from the Riena project:

  • RCP UI looks like the IDE
  • is not that easy on endusers
  • while there is an option to allow “freestyle” there is certain of look that seems well established i.e. Outlook and others (including Riena)
  • there is already some common sense how user interfaces for endusers are designed like MS Office, Lotus etc.
  • wouldn’t it be cool that we have more support for that in Eclipse rather than each application has to build that from scratch.
  • endusers no longer expect their tools to have a native platform look

Are we going to see a UI customization layer in SWT that is similar to Swing’s look-and-feels?

Ribbon reaching beyond Office

September 16th, 2008

The ribbon component is quickly becoming the new standard for Microsoft applications. A significant break away from the traditional menu-toolbar approach that has reached its scalability limit faced with ever-increasing amount of features in the Office suite, it is poised to become the main UI concept in the upcoming Microsoft products.

Speaking at Office System Developer Conference in February 2008, Bill Gates said:

We in the next version of Windows will be using this Fluent [Ribbon] UI quite a bit across a number of applications. […] It turns out it’s a user interface that works very well for the pen and touch [interfaces] as well as being a better way of revealing application functionality.

In his interview, Richard Wolf, general manager of the Microsoft Office Graphics Division detailed the plans for using Ribbon in Visio:

Well, we’ll be announcing that the next version of Visio will feature the new Office “fluent” user interface, or ribbon, which I know has been something many users have been asking us about, so again it’s a question of delivering on what our customers tell us is important to them. The ribbon is key because it allows us to expose more of the functionality of the product. […] The other key benefit that customers will get from the ribbon is a similar way of working to their other Office tools that will make it easier for new users to get up to speed with Visio.

And the recent news confirm the words of Bill Gates. Stephen Chapman has played with an interim build of Windows 7 (next version of Windows OS), and he reports that both Paint and WordPad are now using Ribbon as the primary UI:

MS Paint: In terms of functionality, imagine a software somewhere between the currently-existing MS Paint and the wonderful Paint.NET freeware application. Make everything accessible through a ribbon bar (tabs ‘n all) ala Office 2007 and voila. […] WordPad: Basically, imagine Microsoft taking Office 2007 Word, slimming it down, tweaking the ribbon bar UI a bit, and calling it WordPad. While not as functional as Office 2007 Word (hence, the “slimming it down” mention), this version of WordPad is coming along nicely.

And his next blog entry features a screenshot of Windows 7 Paint in action:

Windows 7 M3 Build 6780 MS Paint UI:

(Click the picture for the full-resolution image)

High-DPI awareness has been the subject of the presentation that i held with Mike Swingler at this year’s JavaOne. This topic has not been getting nearly as much attention as it deserves to, but things might change in the near future.

Ryan Haveson is the program manager lead for the Desktop Graphics team of Windows 7 (the next version of Windows OS). In the article published a few days ago on Windows 7 blog he delves into such areas as scaling modes, programmatic support, current configurations and future plans. One of the main considerations for Windows as the current leader in the desktop presence is backwards compatibility. Ryan’s team must find the right balance between addressing the modern high-resolution hardware and not breaking user experience for older applications:

Our thinking for Windows 7 was that if we enable high DPI out of the box on capable displays, we will enable users to have a full-fidelity experience and also significantly reduce eye strain for on-screen reading. There is even infrastructure available to us to detect a display’s native DPI so we can do a better job of configuring default settings out of the box. However, doing this will also open up the door to expose some issues with applications which may not be fully compatible with high DPI configurations.

As it stands now, applications using GDI have to explicitly scale the visuals:

One of the issues is that for GDI applications to be DPI aware, the developer must write code to scale the window frame, text size, graphical buttons, and layout to match the scaling factor specified by the DPI setting. Applications which do not do this may have some issues. Most of these issues are minor, such as mismatched font sizes, or minor layout artifacts, but some applications have major issues when run at high DPI settings.

While Vista (as well as XP) provide automatic scaling, this results in blurry visuals that do not utilize the full potential of high-resolution monitors:

In the case of automatic scaling, applications which are not DPI aware are automatically scaled by the window manager. The text size matches the user preference, but it also introduces a blurry effect for that application’s window as a result.

It is not clear from this posting what are the exact plans for the next Windows release. The conclusion section is very uncommitting and vague, but it is very encouraging to see that Microsoft is joining Apple and KDE / Gnome in providing tools to scale the UIs to match the current desktop hardware. In fact, the upcoming release 8 of Internet Explorer boasts full support for High DPI mode (though the quote on “entire awareness” of Vista is exaggerated as can be seen from the screenshots in our JavaOne presentation):

Like Windows Vista, the Internet Explorer 8 UI is entirely Hi-DPI Aware. You will also notice that all UI elements and UI fonts are scaled accordingly and that icons are larger and have higher fidelity. Notice the difference in the Internet Explorer chrome when Windows DPI Scaling is set to 96 DPI and 120 DPI, respectively:

Internet Explorer Chrome at 96 DPI

Internet Explorer Chrome at 96 DPI.

Internet Explorer Chrome at 120 DPI
Internet Explorer Chrome at 120 DPI.

It is quite illuminating to read the comments on this entry. Some readers call for the monitor manufacterers to effectively stop the progress and agree on a fixed pixel size:

The physical size in inches should be proportional to resolution in pixels. If [manufacterers] increase the resolution without making the screen larger, it’s obvious that we have problems for reading! I don’t think Microsoft should modify Windows because monitor makers are doing silly things. There should be an international standard for pixel size and font readability.

And going even further to follow Apple’s route:

MAC App developers don’t have to worry about DPI or non-square pixels because Apple has full control over the specification of the MAC monitors. Why Windows can’t do the same and completely remove the scaling burden from app developers? Microsoft should use its influence on PC manufacturers and ask them to build monitors to Windows certified specification.

One reader points to a bit of a chicken-and-egg problem:

Programmers don’t bother with DPI aware apps, because all mainstream monitors have their physical DPI @ 96. And monitor makers don’t bother with making bigger DPI monitors, because apps aren’t there yet. The only solution I see, is to bite the bullet and at default make Windows adjust to the native resolution/DPI.

And a sane voice points to a solution that does not involve user intervention at all, hiding the pixel-point-inch impedance behind the scenes:

Windows 7 should automatically set your monitor at its native resolution. It should then determine the best dpi for your display and automatically scale the entire OS to it, afterwards if you want to set it at a different dpi then you can.

While the hardware technology of high-resolution monitors does not progress at nearly the same rate as other parts of the consumer-oriented market (CPU, GPU, RAM, hard disk, etc), it is evolving nonetheless. The major operating systems and windowing toolkits differ in their level of support. Hopefully, Microsoft’s awareness of the importance of this subject will not be significantly hampered by the shackles of backwards compatibility.