Roadmap for Substance 5

April 22nd, 2008 | 25 Comments »

With release 4.3 of Substance look-and-feel available last Monday (and a few patch releases to address bugs since then), it is time to think about the next release. Substance is now three years old and it has seen fourteen releases since it was started in April of 2005. Most of the minor releases did not introduce binary incompatibilities, and the last two major releases (3.0 and 4.0) touched the public APIs in ways that should have affected only a small portion of users. However, due to my very heavy commitment to make Substance the library of choice to create modern user interfaces (and resulting short release cycles), sometimes i have made bad decisions on the features to include and the APIs to expose them.

Over the last year and a half the Substance codebase has become a complex thing to understand and maintain. Every new feature that has been added (especially the skins and decoration areas) made it ever more difficult to maintain backwards compatibility and still address the needs of designing modern UIs. This sometimes led to an awkward implementation and even more awkward public APIs (as anyone who dared to use a SubstanceComplexTheme would attest).

Even though i am the single developer on the project (but thanks to all those who sent bug fixes and graciously contributed portions of code), i found it increasingly harder to understand and extend existing functionality. And here i am not talking about working on the project every other weekend; i look at and work with the code pretty much every day. Something had to be done, and over the last eight months i have considered the two options that i had.

The first option would be to start a new project. Learn from all the mistakes that i’ve made, all the features that were added and not used, all the accidental complexities that grew exponentially and didn’t really mesh well together, all the nice-to-haves that added performance hit even when not used. In short, stop working on Substance (moving into maintenance bug-fix mode only) and start anew.

The second option would be to wait for the next major release and do all the things necessary for the long term health and viability of the project. To rework the cruft and the mess into an API that best reflects my understanding of creating modern UIs as i see it at this moment. To put myself into my users’ shoes and question every client property, VM flag and API method. To see how hard it is to customize the default behavior without reading the Javadocs and the documentation. To see how hard it is to create a custom skin after reading the source code of existing core skins. And most of all, to see what can be sacrificed in the short term to address the long-term problems.

The first drop of the next major release (code-named Substance 5) will be available for download tomorrow. Here is the list of major changes that have been made to the core library and its plugins.

  • Requires JDK 6.0. The only VM that is being used for tests is 6u10.
  • SubstanceLookAndFeel class is now abstract and does not have any public constructors. Use a core skin-based LAF, extend to set a custom skin or use static setSkin method.
  • Removed support for pluggable text rasterizers (substance-bramble plugin based on SWT). 6u10 addresses poor Segoe UI rendering on Vista.
  • Addressing performance. The first drop of 5.0 is 20% faster than release 4.3. This is work in progress.
  • Reworked notion of themes. Split the functionality of SubstanceTheme, SubstanceComplexTheme and SubstanceSkin into SubstanceColorScheme, SubstanceColorSchemeBundle and SubstanceSkin. Tweaked most of the core skins to take advantage of the new more flexible and straighforward APIs.
  • Removed most of the VM flags. The only two flags are for tracing memory allocation and heap status. Use skin / image watermark / configuration APIs.
  • Reconciled APIs that were added to address specific user requests and did not result in a consistent API. This should make making a custom skin / tweaking default Substance behavior easier and more straightforward.
  • New client property to provide per-window skinning. Can use different skins for different top-level windows.
  • Removed the client properties and APIs for setting themes and painters on per-component level. Use colorization client property and per-window skins for custom tweaking.
  • The new default mode does not add any extra UI elements (menu search, lock icons etc).
  • Removed performance-adverse functionality of custom overlay and composites. Was unintentionally broken since release 4.2 and intentionally unfixed in both 4.2 and 4.3. A single complaint shows that this functionality is of minuscule use.
  • Removed combobox auto-completion. Use SwingX, GlazedLists or JIDE.
  • Moved UI debug mode (additional context menu on title panes and scroll bars) to a substance-tools plugin
  • Consolidated existing theme pack, button shaper pack and watermark pack into substance-extras plugin
  • New SubstanceApi annotation marks public APIs (classes, constructors, methods)
  • Internal restructuring of the packages to make the codebase more organized.

Undoubtedly, the most important bullet in this list is moving to JDK 6.0 as the runtime requirement. This has not been a minor decision. I understand that for a great number of users this will mean that they will not upgrade to Substance 5. I am doing this for the long-term health of the project.

At this point, release 4.3 officially enters into the longterm bugfix mode. With older releases i only backported bug fixes during the first week after a stable release. Release 4.3 will continue to receive all but most complicated bug fixes to accommodate users that can not upgrade to Substance 5 (due to JDK requirements).

For more information on changes to the client properties, VM flags and APIs consult the first draft version of the API change overview document. The project documentation will be updated in the following weeks.


Related posts:

  1. Substance 6.0 roadmap Today I want to share my plans for the next major release of Substance look-and-feel...
  2. Release candidate for Substance 5.0 I am extremely pleased today to announce the availability of release candidate for version 5.0...
  3. Releases for Substance, Flamingo and more I am extremely pleased today to announce the availability of official releases for a number...


25 Comments on “Roadmap for Substance 5”

  1. 1 Martijn said at 11:52 pm on April 22nd, 2008:

    I really like Substance, and we use it as the default Look and Feel for our main application at the company that I work for. We’ve just switched our main branch of code to Substance 4.3.

    But I am wondering, out of curiosity: why are you switching to JDK 6.0 for Substance 5?

  2. 2 besidj said at 7:49 am on April 23rd, 2008:

    Hi Kirill!
    I just want to say one thing: Substance is great!
    I am using it since version 2.0 as the default look and feel for my open source project, now hosted at Sorceforge. I have already moved to JDK 6, so there would not be a problem to upgrade to version 5.0. I am waiting for the new releases of Substance.

    Special thanks,
    Besmir

  3. 3 Ouaibsky said at 1:15 pm on April 23rd, 2008:

    Hi Kirill,
    First, Thx for your job, substance is a really nice project.
    I understand your decision and i’m quite ok.
    I think that, too often, java developers (including jdk) are absessed with a backward compatibility. Sometimes, to evolve, we have to make structuring choices which break the past.
    With regard to performance, this is a good news. I design trading application and we do not use Substance 4 for performance reason (memory allocation). As you said many time it was not the purpose of this L&F. Now we will monitor this version 5.
    Special Thx again.

    Christophe.

  4. 4 Kirill Grouchnikov said at 10:23 pm on April 23rd, 2008:

    Martijn,

    I don’t see any reason why not to switch to JDK 6.0. It has been officially released almost 18 months ago and JDK 5.0 has entered end-of-life about two weeks ago. There are a few new APIs that i can use in JDK 6.0 (such as multistop linear gradients that make Substance run a little faster). I also can remove reflection code that used JDK 6.0-specific APIs, such as table header sorting for painting the sort arrows. I can also start using SwingWorker and new collection / concurrency utilities when i need them. The development of Substance has been noticeably hindered by not moving to JDK 6.0 over the last year.

    Thanks
    Kirill

  5. 5 Rajesh said at 11:21 pm on April 23rd, 2008:

    Kirill Grouchnikov,

    Good decision pal, Substance is one of the best projects around.I will like to add on your list keep memory usage and CPU on prime importance,I personally observed that with every new release substance talking more CPU for itself rendering so I was not using it for heavy swing projects.The more configurable thats cool at least can turn off animation on projects that really does not need.
    I have been following and using substance for long time now,I have seen API and I think your decision is good one.
    Seriously looking forward Substance 5.

    regards,
    Rajesh

  6. 6 Martijn said at 12:25 am on April 24th, 2008:

    Kirill,
    Since you said it was ‘not a minor decision’, I was just wondering if there were any specific ‘killer’ features that had you move to JDK 6.0. And I had not heard that JDK 5.0 had entered its EOL period.

    The code base I work on is unfortunately still JDK 1.4, since we have a variety of customers running Novell Netware or older versions of AIX or HP-Unix for which no JDK 5.0 has been released.
    Our solution is to load/control Substance using reflection if the application detects it is running on a JDK 5.0 or higher VM (which is quite a hindrance, but I guess you know that if you had to call JDK 6 features the same way). I was just hoping we could ditch that reflection code when we finally move to Java 5. Ah well, we’ll just have to keep using reflection when Substance 5 comes out then.

    Keep up the good work,
    Martijn

  7. 7 tito said at 6:01 am on April 24th, 2008:

    Hi Kirill,

    Thanks for sharing your roadmap!

    I love substance and have been using it very happily for a number of years. The most powerful characteristic about it to me is that it just looks good. It makes any app look better. Every once in a while I’ll grab another L&F just to compare it and I am always underwhelmed by their offering relative to yours – they just don’t look as good.

    Most also don’t have the variety and breadth of features you’ve developed.

    The one area where Substance is really (relatively) weak is performance. To me, you’ve already built the nicest and richest L&F available. The performance is very nearly a deal-breaker, though. I agree with your move to 1.6 and your refactoring of your APIs, but if there’s one thing I could possibly put towards the top of your list, it would certainly be to address performance.

    As always, thank you so much for the great effort you’ve put into the remarkable fruit of your labor. Best,

    Tito.

  8. 8 Hendrik Ebbers said at 11:45 am on April 24th, 2008:

    Substance ist great. The Roadmap looks good.

  9. 9 Kirill Grouchnikov said at 1:09 pm on April 24th, 2008:

    Rajesh, Tito

    The performance will be one of the most important aspects for me in version 5.0. The first drop (available on the project site) should be around 20% faster than the 4.3 release, and this is still work in progress. My internal benchmark shows that Substance is currently only twice slower than Nimbus (that had the “luxury” of fixing d3d accelerated pipeline bugs such as this and this). As already said, this is work in progress.

    Thanks
    Kirill

  10. 10 Dmitri Trembovetski said at 11:31 pm on April 26th, 2008:

    Hey, we’ll gladly fix any d3d-related issues, doesn’t matter if they affect Nimbus or any other L&F. Just use 6u10 and file bugs..

    Dmitri
    Java2D Team

  11. 11 Luke Sleeman said at 12:05 am on May 5th, 2008:

    Its great to hear about the changes coming up in the new version of substance! I’m sure the decision to go back and reactor and cleanup with pay long term dividends, both in maintainability and how quickly you can develop new features.

    That said I’m wondering why you decided to pull out the PAINT_ACTIVE_PROPERTY client property? Its one thing our software uses quite a lot. Still, I am sure I’m sure we can find some way to work around PAINT_ACTIVE_PROPERTY being removed.

  12. 12 Kirill Grouchnikov said at 7:55 pm on May 8th, 2008:

    Luke,

    I think that you would find the colorization client property a suitable and better replacement for your requirements.

    Thanks
    Kirill

  13. 13 Tomas said at 12:05 pm on May 15th, 2008:

    Hi Kirill,
    thank you for great Substance project! Applications in Java now look fantastic. Looking forward the new version 5.

    Tomas

  14. 14 Qil said at 7:36 am on May 20th, 2008:

    Thanks, Kirill!
    Substance is the first stuff that make me and my friend realize that in fact java desktop also can be very very beautiful.

  15. 15 Kirill Grouchnikov's Blog said at 1:43 pm on May 28th, 2008:

    Performance improvements in Substance 5

    Addressing the user complaints on bad performance of Substance look-and-feel.

  16. 16 Tony Anecito said at 9:33 pm on June 18th, 2008:

    Hi Kirill,

    Thanks for addressing performance issues and doing testing on 6u10. I stopped using Substance because of performance and issues with 6u10.
    I will try to take a look at it again. Hopefully you have updated webstart demos to version 5?

    Has Romain Guy looked at version 5? Be interesting to get his feedback.

    Thanks,
    Tony Anecito
    Founder,
    MyUniPortal
    http://www.myuniportal.com

  17. 17 Kirill Grouchnikov said at 8:29 pm on June 19th, 2008:

    Tony,

    The WebStart demo always uses the latest dev version. You can see the bottom-left corner of the test app for the build time and the version.

    Thanks
    Kirill

  18. 18 wahid said at 3:07 pm on June 25th, 2008:

    great work kirill on the substance LnF.
    i would love to use this in my new project but there is a small glitch in the scrollbars..let me explain,
    when i move the mouse over them there is a flicker (it kind of changes color) and then goes back to it correct color state,and if i move the mouse away from the scrollbar the same happens again!
    this is extremely annoying considering its a simple bug , is there a possibility of a fix soon?

    on a different note, is it possible to have a pallette jinternalframe since i tried it and got the standard jinternalframe with title ?

    great work , keep it up (how do u find the time??)

  19. 19 Kirill Grouchnikov said at 4:12 pm on June 25th, 2008:

    Wahid – is this under version 4.3 or 5.0dev? If you have a reproducible scenario, please post it on either the project forums or mailing lists.

    To your other question – palette internal frame is Metal-specific functionality that is not supported in other core look-and-feels (as well as in Substance). For more thoughts on this subject please refer to this forum posting.

    Thanks
    Kirill

  20. 20 wahid said at 3:59 am on June 26th, 2008:

    hi,
    thanks for that kirill,
    I guess i must have been using an older build as i just tried the webstart demo and all seems OK now.
    I look forward to the next release!

    regards,wahid

  21. 21 Norman Acosta said at 2:47 pm on August 13th, 2008:

    Hi Kirill.

    I download the source for the substance api, i need to create a new skin but i can’t make it work i don’t know how to use the build.xml file, i made a new project in netbeans and take the source code the libraries and i build it succesfully but when i remplace it in my application that works with a compiled substance i can make it work.

    Could you help me?

    Thanks a lot

  22. 22 arm said at 11:43 pm on September 22nd, 2008:

    Hi Kirill

    Thanks for this beautiful library!

    Substance 5.0 seems nice but some features are
    evaporated. For instance, TABBED_PANE_VERTICAL_ORIENTATION
    is no longer available, with no API replacing it. Tabbed panes
    with vertical labels are nice to see the first time, but in the long run
    they are disturbing.

    Regards
    Angelo

  23. 23 Kirill Grouchnikov said at 10:01 am on September 23rd, 2008:

    Angelo,

    In general, i have not seen a single application that puts horizontal tabs on the left or right sides of the tabbed pane. I haven’t even seen a lot of applications that put anything there, but when they do (such as NetBeans or IDEA), the text is rotated so as not to take too much valuable horizontal space.

    Thanks
    Kirill

  24. 24 Steve said at 8:29 pm on December 18th, 2008:

    Hi Krill,
    We are very pleased with the performance improvements of Substance 5.0. We are wanting to use substance for the performance improvement alone.

    Our touch screen POS application is light on text, and just by virtue of the screen ratio, vertical space is more valuable than horizontal space.
    So the vertical tabs are a show stopper for us.

    Please tell me there is a way to turn this off.

  25. 25 Kirill Grouchnikov said at 9:08 pm on December 18th, 2008:

    Steve,

    The rotation of left / right tabs is by design and is not configurable. If you want to change this, you would have to extend SubstanceTabbedPaneUI and override all methods that have “toSwap” variable in their first few lines.

    If you wish to further discuss this, please subscribe to the “users” mailing list of the project and continue the discussion there.

    Thanks
    Kirill