The Source for Java Technology Collaboration
User: Password:



Kirill Grouchnikov

Kirill Grouchnikov's Blog

Who doesn't want the transition effects in Swing applications?

Posted by kirillcool on April 09, 2007 at 10:45 AM | Comments (32)

Over the past two years, the Swing community has seen a few efforts to provide transition effects. I had first heard it mentioned by Chet in 2005 in one of his JavaOne sessions. He was speaking about not "surprising" the user when you change the UI elements. When a control is added, it can fade in or fly in, when a control is removed, it can fade out or fly out, and when a control changes location, it can slide to the new location. Joshua and Chris's "Swing Hacks" (that was published that same year) provided an implementation of transitions on tabbed panes that allows PowerPoint-like crossfades on tab selections.

The last year saw a number of attempts to provide generic implementations of the transition effects:

  • The TransitionLayout introduced in my blog which is available at the look-and-feel level (with a few limitations).
  • The JXLayer approach pioneered by Alex which is available under all look-and-feels.
  • Yet another approach from Simon.

On top of these three, Chet and Romain are working on yet another implementation, tentatively called AnimTrans (or TransAnim? ), which should be publicly available around this year's JavaOne.

So now that we have at least four different implementations of the same thing, the main question is "do we really need them at all?". I know, i know, your first reaction would "OMG, what are you talking about, this is way too cool and i can't wait to use this in my next w00t app". Just look at the number of comments on the three blogs mentioned above (about 40 on Simon's blog, about 40 on mine and even more on Alex's). However, this is only one part of the story.

The first entry about TransitionLayout on my blog was last September (more than seven months ago). Since then, i haven't received a single request / defect report / question about it. And believe me, there could've been plenty, especially with all the restrictions placed on the application code (playing with opacity, visibility, borders, layout manager and complete lack of support for fading out the removed components). I've asked Alex about what type of questions does he get on JXLayer, and it's the same with him - not a single question about the transition effects. I can't say about Simon, but i feel that it's the same there.

Which brings me to a puzzling conclusion - perhaps the Swing developers just want to see the shiny things (and be reassured that they are possible not only in Flash), but have no interest in using them outside of the demoes... What do you think?


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment


  • To me, it seems that part of the problem is that there are too many implementations. Now, it's nice to have options, but in this case it might be difficult to figure out which one to use. I would say you'd see more adoption if there was a standard implementation for this stuff.

    A lot of these seem nice but many are personal projects, and it's a bit scary to base your product on a library that is not that widely used, and based on a single or a couple of contributors. At this point what we need to be evaluating is how to make these type of effects part of Swing, if there is a real need for them.


    Augusto

    Posted by: augusto on April 09, 2007 at 11:21 AM

  • I don't want transition effects anywhere near me.

    I want a UI that responds instantly (50-100ms from mouse down to completion, tops) and doesn't go off and do peculiar things by itself.

    Posted by: tackline on April 09, 2007 at 11:56 AM

  • I want my UI to have spiffy transitions and springs and such. However, I need to finish the core features before I have the chance to add the polish and shine. I'll get right on it as soon as I have this next feature done... oh and the one after that... oh and this other one... I'm sure I'll get to it some day.

    Posted by: tcbinjon on April 09, 2007 at 12:12 PM

  • The long and short of it is there are several different solutions to animation/transitions and the different libraries all address use-cases of their own. Personally I don't think GUI transitions are that important compared to the quality of the UI itself.

    Posted by: bugfaceuk on April 09, 2007 at 12:22 PM

  • Personal answer: I've bookmarked all of the threes and downloaded two of them. I do want transitions (to replace a quick and dirty component I've written) but my higher priority is to finish some testing, mainly about installation problems of my platform with Linux. After that, I'll evaluate the best transition solution and upgrade it.

    General answer: I have a somewhat puzzling opinion on the community. Sometimes I think that it's not much responsive as one would expect.

    Posted by: fabriziogiudici on April 09, 2007 at 12:39 PM

  • Oh I like shiny things, but also like responsive UIs. Better yet I _love_ shiny and responsive UIs, so my vote is yes, we need transitions. I'll be doing'em if I were working on desktop apps for a living =)

    Posted by: aalmiray on April 09, 2007 at 01:50 PM

  • Learn to walk before you can run. Get the basics right first.

    Posted by: goron on April 09, 2007 at 02:06 PM

  • Transitions are actually a way to make the UI look more responsive. And transitions can be fast (a fade can be effective in the 50/100ms range.)

    Posted by: gfx on April 09, 2007 at 03:43 PM

  • I suppose that to start using transitions the whole app should be designed in that way. It's too early to expect adopting such things.

    For instance, http://fourthelephant.com/ was designed with animation in mind and it works that way. Things like IntelliJ IDEA are almost impossible to be redesigned for transitions and fancy animations since there are lots of code that doesn't expect such things to happen.

    Posted by: kirillk on April 09, 2007 at 10:39 PM

  • @kirillk - It depends. Usually transitions can be managed by using a special subclass of JPanel or such, so the point is: how easy is it to replace/plug it into the existing code? Things aren't necessarily so hard.

    OTOH if you're working on a complex framework such as NetBeans RCP you have to extend the above question to the existing classes in the framework. I've did just a little work in this area (more to come), but here there are some hard points.

    Of course there are frameworks such as Eclipse RCP where you can't simply do any transition since Eclipse is not based on Swing and AFAIK there are no transition libraries for SWT. :o)

    Posted by: fabriziogiudici on April 10, 2007 at 04:57 AM

  • I personally find the fades look too much like a slow LCD. Animations (moving images) communicate better when trying to direct the user's attention to something new in the UI.

    Posted by: twalljava on April 10, 2007 at 05:20 AM

  • This link http://rabbit-hole.blogspot.com/2007/04/animated-per-panel-options-pane.html demonstrates an animation I actually *used* in a production applet (see if you can find it on the web, I can't actually link to it just yet).

    The first comment on Simon's effort (about a Commodore 64) is very accurate as well as humorous. None of these effects would get your demo reel into the inbox of any animation house.

    Flash has so many visible example variants on the web because they have libraries that make it very easy to do both trivial and complicated animations (and not just with UI components; remember that those were added much later). The number of people who can say "move the sprite in a circle for three seconds, then explode-transition to my photos" is much broader than those who can say "import javax.swing; ...", if you get my meaning.

    Posted by: twalljava on April 10, 2007 at 05:34 AM

  • Borrowing from the conference guys, I want no fluff, just stuff. Transitions, yuk. Fake glare, yuk. Pulsating buttons, yuk. Just stuff, please. :-)

    Oh, for slide shows, I like transitions and animations. Maybe because I'm passively being entertained? But when working, it's just noise.

    Posted by: detorres on April 10, 2007 at 07:53 AM

  • I think part of the problem is that client-side/UI coding is generally under valued. It might just be I've been unlucky with my employers, but I'm always in the situation where the project has planned days for UI work instead of weeks. I'd find it a very tough sell convincing my boss to let me spend time adding animations and transitions to an application. The incentive for your typical bread & butter database front-end application just doesn't exist at the moment.

    Another concern is that to pull this off well demands a slightly different skill-set to a traditional swing developer. Less layout & design and more storyboarding and effects wizard. In many ways client-side is a niche corner of Java development and transitions very much a niche corner of that. So it's not surprising it's mostly the domain of the renaissance developers like yourself and Romain.. oh and Chet too, but I wonder if he hasn't been tasked with keeping up with WPF. Which in turn may turn the tide once animated transitions become accepted as the norm and static UIs start to feel old & busted.

    Posted by: osbald on April 10, 2007 at 08:25 AM

  • I want them when they work and are easy to integrate into my apps.

    Posted by: rabbe on April 10, 2007 at 08:38 AM

  • As was said before, I don't need the fluff, but I do need a fast bug free tool.
    I have not been able to understand the emphasis on L&F. Please focus on the core.

    Posted by: seapwc on April 10, 2007 at 09:30 AM

  • @fabriziogiudici "Swing and AFAIK there are no transition libraries for SWT"

    I remember someone implemented SWT in Swing. There was even an article here on java.net about it. I can't for the life of me remember what the name was.

    Posted by: aberrant on April 10, 2007 at 09:33 AM

  • @aberrant You remember well, it's swtswing and EoS (Eclipse on Swing). It's a respectable work, but I'd like to know whether people are using it - for instance, I'm a bit skeptical about performance, as we have an abstraction layer over another abstraction layer.

    In any case, it's not a transition library for SWT: probably you can do transitions with swtswing and EoS, but you have to use mixed APIs: SWT for your main work, Swing for the transition. Doesn't look as the best thing in the world.

    Posted by: fabriziogiudici on April 10, 2007 at 10:04 AM

  • I always wonder why there exists so many implementations in the swing community. There are so many good projects going on ..but the problem seems that there is a great deal of overlap between these projects... Take for example the timing framework of chet vs the animation framework of BUGSBlog or JXLayer vs SwingxPainters. I think making one polished and complete framework would benefit the swing community .

    Posted by: psychostud on April 10, 2007 at 12:25 PM

  • I think we need a JSR to take all the implementations out there, bring them together in one implementation, and provide the ability to hook the behaviour in with the actions provided in JSR-296 Swing Application Framework. This framework provides a standard for creating responsive UIs through proper threading and can be extended later for the attachment of cool effects. Adding a wipe left or fade in to a window or dialog during close would be slick. The UI responsiveness problem is already being addressed. Now we need some bling to compete with Flex.

    Posted by: gyetko on April 10, 2007 at 12:41 PM

  • Yes, Java needs 'shiny' stuff. Part of what it takes for Desktop Java is to keep the pace with current UI/Usability trends.

    do we really need them all

    While I think it is a a good thing that there multiple implementations of graphical-transition-effect frameworks (and other desktop frameworks), I do think we are coming to a point in the community where there needs to be a convergence of energy and ideas. Not only in the 2D/3D effects space, but also within app-frameworks, binding, etc.
    Take for example what is happening with the JSR295/296 support in NetBeans; I would like (expect) to see some SwingLabs/TimingFramework/AnimatedTransition integration to follow. If not initiated by Sun, then by the community.

    Posted by: wsnyder6 on April 10, 2007 at 12:46 PM

  • "Please focus on the core."

    Given that most of this work happens on people's spare time, do you think this is something you can really ask for? It's free, open source and Kirill, Simon, Chet, etc. worked hard on those things. If you don't need them, no problem. But don't expect them to please your will :p

    Posted by: gfx on April 10, 2007 at 01:08 PM

  • More than all this effects I want a basic, standard, easy way to build swing apps. I am waiting on them for 5 years now. There has being a lot of improvement but still not enough to convince my boss.

    Posted by: levmatta on April 10, 2007 at 03:31 PM

  • Well this is getting a bit repetitive isn't it?
    We all get that we want easier Swing/Java UI development, that doesn't mean we can't have this as well.
    There really should be a JSR or maybe just a community effort to build a single solution, and whatever that is, it needs to be tied into at least one IDE (have tool support).

    For timing frameworks, what Chet has is awesome, but perhaps the next step again is on the tooling side. Can you imagine if you had a visual editor for animations and transitions in Netbeans? I'm sure the Blu-Ray guys would love that (if they don't have something like this already).

    Posted by: augusto on April 10, 2007 at 04:58 PM

  • @levmatta

    You should definitely check out Matisse in Netbeans 6.

    As for the question of UIs with slick effects, I think that the problem is the hurdle that we have to get over to use them. I for instance find that I would have to learn the intracacies of Timer and how that interacts with the main event thread plus one or more of the many fancy graphics packages out there (JAI, Java2d, Java3d, OpenGL, JOGL etc).

    This is a bit like what someone (one of the Bruce's) said about learning J2EE - it is like eating an Elephant. Now if I had a swing project I would have the time and incentive to take a bite at a time.

    But it is kind of a vicious cycle. Because there are so many bad looking swing apps, people discount it as a good UI technology... and that means that there are few new projects which set out to use swing.

    So, then do I have the motivation to learn a mostly new way of doing UIs? But wait, there are other technologies vying for my spare development/learning time... Ruby, Python, .Net, Tcl/Tk etc.

    And the winner is... Cocoa. :D

    Posted by: rickcarson on April 10, 2007 at 05:09 PM

  • I'm definitely concerned about how well animated transitions will work in a Citrix or LTSP environment ... especially where there are 15 sessions on the same server all running the same app with lots of transitions. Flash is already a bit jittery in this environment ...

    Posted by: jsando on April 10, 2007 at 07:00 PM

  • I don't think transitions actually make a massive amount of difference when running the application. Sure, a few effects can be useful -- a page flip in an address book application, for example -- but mostly they are just eye candy.

    HOWEVER, one thing that bling does do is catch the eye, and in the same way that car manufacturers spray the interior of each vehicle with that "new car smell", bling adds a gloss which helps to sell an application. If one took two identical applications, one with and one without bling, and showed them to a potential user, chances are 90% of the time they'll buy/download the blinged up version (even if they end up switching off most of the transitions when they use it.)

    I think the power of bling as a selling point was rammed home recently when I pitched for some work from a very very well known media company. I can't really talk about this in public, but if yourself, Romain and the usual suspects are interested I'll email you a tale of woe about Swing loosing to Flash when it really shouldn't have!!

    Posted by: javakiddy on April 11, 2007 at 03:34 AM

  • OMG, what are you talking about, this is way too cool and I can't wait to use this...

    ... actually correct that, I already have it in my next app. I have a beautiful tab transition effect using JXLayer which smoothly, quickly but gently fades in the selected tab... AND IT LOOKS AWESOME.

    I think it is a testament if the library works without a lot of issues.

    I also think that most developers have to work on fundamental functionality and bugs prior to usability/visual enhancements.

    However I am extremely appreciative of the efforts and believe it moves Swing along in the right direction

    Posted by: aronsmith on April 11, 2007 at 05:45 AM

  • @rickcarson: Tcl/Tk? You, sir, are dangerously insane :)

    Posted by: gfx on April 11, 2007 at 02:35 PM

  • Kirill,

    Who doesn't want the transition effects in Swing applications?

    xul, flex, Micro$oft, oh and boring folks, and anyone who wants to create nice RIA on the client (not using swing).

    Steak is good, but the sizzle makes it all the better.

    -Carl

    Posted by: carldea on April 14, 2007 at 02:43 PM

  • It is great that someone is doing the transisition effects, but as a developer it is at the bottom of the list of my wishlist.

    What is higher?

    * A framework for screen modes (full screen, normal window, compact window)
    * Office 2007 widgets
    * A substance based framework using the framework JSR

    Posted by: jelliffe_rick on April 16, 2007 at 01:42 AM

  • Rick - i'm not sure that i follow the "substance based framework" bit. Substance is just a look and feel...

    Posted by: kirillcool on April 16, 2007 at 08:46 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds