The Source for Java Technology Collaboration
User: Password:



Frederic Barachant's Blog

Swing Archives


Interactive splined animation: first example

Posted by pepe on March 02, 2008 at 09:45 PM | Permalink | Comments (4)

the new demo tabSplines project now has its first incarnation within swash and the example chosen is the perfect one.

In a previous blog, Tim Bourdreau asked for the difference between splines project and java.awt.GeneralPath. Here i show some of the main reasons why generalPath could not be used:

  • Path can be changed anytime and displayers update themselves upon modification. No hassle.
  • Modifications on paths are very simple to operate
  • Having seperate splines for each ordinate makes it easy to change direction of the thrown gear. Using GeneralPath would have been a nightmare.
  • Sections of the splines are independent on each ordinate.
  • Velocity of the gear can easily be set and changed.

Demo consists of a gear that can be thrown to the wall when pressing a button. Gear bounces on bottom of the zone then on the wall and bounces back. Wall position can be changed anytime (even when animation is running, which can be funny on some cases when the gear bounces two times on wall :) ) and you will see splines being adapted in realtime.


There are two goals in this demo; show why splines project is done like that and show how to animate within swash.


Kudos go to the java2D and swing teams. While the animation runs at 50fps, there are no hiccups and cpu used is at 0%. Antialias is at max, and the gear rotates so it ought to take power from my old prescott and my even older ATI 9600.

the hit logo
WebStart the demo !
Check the project page for swash
Check the project page for splines




Realtime Animations within matisse

Posted by pepe on February 13, 2008 at 10:37 PM | Permalink | Comments (2)

A bug corrected in latest netbeans 6.1 enables swash to display its animations realtime while you edit withing matisse. Great effect and good step ahead in productivity.

Thanks goes to Tomas Pavek for that. Even if the bug report was a bit old, he fixed it as soon as he got his eyes on it and i admit i really waited for it.

So, here is a little swik capture that shows how animated components are shown. Unfortunatly, swik goofed a bit and does not show animations correctly as they are perfectly smooth on my screen, but you will see them jerk. Bah, i'm so happy i do not really care.

Fun thing is that you can edit, duplicate, add components over and under animations and matisse does not matter. Everyting just animates smoothly while you setup your UI.

Lovely day. :)





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