Introducing Trident – animation library for Java applications
February 14th, 2009 | 19 Comments »Trident is the next evolutionary step of the animation layer that drives the animations in applications powered by Substance look-and-feel. The underlying animation engine has been in development and production use over the last two years, but the API was heavily oriented towards the UI delegates in custom look-and-feels. One of main goals of Trident is to preserve the power, performance and expressiveness of the existing animation engine, while at the same time providing a set of simpler APIs for use in application code.
The first drop of source code, build scripts and the runtime library are available in the download area and in the SVN, and in the next few weeks expect more polishing of the API, additional examples and documentation. For now, allow me to leave you with two demo videos that follow Chet’s examples from the next version of Flex:
Related posts:
- Introducing Project Granite – Animation Blueprints for SWT Project Granite aims to provide blueprints for adding animation to SWT applications using the Trident...
- Introducing Project Onyx – Animation Blueprints for Swing Project Onyx aims to provide blueprints for adding animation to Swing applications using the Trident...
- Project Marble – augmented reality in Java with JMF, Java3D, NYArToolkit and Trident Today i’m going to talk about setting up the development environment for running the augmented...
- Trident 1.1 – supporting Java-based UI toolkits Trident animation library for Java applications is nearing release 1.1 (code-named Bogeyman), and it’s time...
Hi Kirill,
What does it bring over TimingFramework or Scenario?
Romain,
I’m not familiar with the capabilities of Scenario. About timing framework – there are some pieces that are not supported by Trident, mainly triggers and keyframes. On the other hand, i would say that there are three big pieces missing in timing framework:
1. One thread to drive all timelines. The second video shows about 50 timelines (the dots in the bottom part). I do remember you saying in J1 presentation that each animation is driven by a separate thread.
2. Multiple timelines of the same kind can run on the same object. This is relevant for renderer-driven components such as lists, tables and trees – where you want to have separate rollover timelines over separate cells.
3. Timeline scenarios where you can add multiple timelines and swing workers, define dependencies between them and let Trident figure out which ones are ready to run at every animation cycle.
And yes, Trident most definitely draws on some ideas from TimingFramework and Gumbo animation layer as shown by Chet.
Thanks
Kirill
1. TimingFramework supports it actually.
2. and 3. are handled by Scenario.
Hi Kirill,
Not sure what you mean by (2), or what problem you ran into with the Timing Framework related to this.
For (1), the multiple-Timer problem (not multiple threads; each Timer was on the Swing thread, but it was a bottleneck when you had many animations, as one of the JavaOne demos showed) went away in Scenario, since everything is driven by a single timer. Or at least it was the last I saw, but my knowledge of it is a tad out of date. Similarly, all animations in Flex are driven by a single timer pulse; it’s really the way to go in a UI animation system.
On (3), we also beefed up the Timeline and animation dependency system in Scenario from where it was in the much more basic Timing Framework.
Chet.
Heh, just saw Romain’s reply. Yes, the TF supported things from a single pulse, but it wasn’t the default behavior. I believe one of the demos we showed at JavaOne last year showed how to make this work through the TF.
Chet.
Chet – i think that i raised issue (2) a number of times. An example would be to have FG / BG color animation on list cells. What is the target component? The renderer is used for all the cells – unless you want to return a fresh renderer instance just for the sake of rollover animations.
Chet / Romain – moving the functionality to GPL-based scenario is not suitable for some of the applications. In addition, it does look like SceneGraph hasn’t been updated in a few months, and i would guess that new JavaFX functionality is not being backported there.
But perhaps above all, i view TimingFramework as prior work to learn from, but not necessarily as the final say in the animation realm. The same goes for Substance and my other projects.
Thanks
Kirill
Hi Kirill,
This is very interesting, nice work. Something similar is PulpCore, which also has its own animation framework. It has some interesting animation algorithm types here: http://www.interactivepulp.com/pulpcore/easing/
I really like scenario, i’ve had both good and bad experiences with it.
First it’s stable and has a relatively complete feature set. There’s to my knowledge very little bugs. However i recently came upon one. I couldn’t fix it because the animation support is not easily extensible. The animation base class contains package private methods and the derived classes are final. Even if scenario’s current version were open source, i’d basically have to fork the whole shebang to fix bugs or add features :)
The old 0.6 version is indeed hard to use because of the license and bug fixes (and maybe features) missing compared to scenario 1.1, and the 1.1 is indeed hard to use too for the reasons i just mentioned and because of the license too.
Kirill,
For the first issue, targeting a renderer, TF was never intended to be specific to components or any other objects; it’s just about animating properties on objects. If those objects happen to be renderers used by components, that should work fine. Animations are just about varying values over time, not about varying values on specific types of objects.
In fact, that’s part of what I’m doing on Flex in the next release: taking the animation system from being component-specific to being generically applicable to any targets. This is particularly important as we start incorporating graphical objects (!= components) and shaders/filters into the overall system of how UIs get displayed.
As for the licensing issues around Scenario or whether you’re using it, the TF, or anything else, I think we were just discussing what capabilities were in each system, not trying to tell you or others what to use or borrow from…
Chet.
Chet,
I think that the design of any library should be driven not only by the purity of its API and applicability to generic objects, but also by real-life simple *and* complex scenarios. Interpolating FG / BG colors of cell renderers in Swing is one example of such a complex scenario, where varying the values of a renderer is not good enough when it is used in multiple cells.
And by the way, Trident’s timelines are not specific to Component / JComponent and can be used on any Java objects. The circles / rectangles in the first demo are one example of that.
Thanks
Kirill
[...] look and feel project, his Flamingo components project (including Ribbon component) and the new release of an animation library called Trident, which evolved out of his work for [...]
Hi Kirill
Did you happen to look at Swash (https://swash.dev.java.net/, docs at http://wiki.java.net/bin/view/Javadesktop/Swash) while developing Trident?
Patrick
Chet,
Is it legal to use a GPL-licensed Scenario in a commercial product so long as you don’t modify the library itself? Or does the license require me to GPL my product as well?
Thank you,
Gili
Kirill,
as to animating properties of a renderer: the SwingX way of achieving that is to animate the properties of Highlighter/s (with whatever animation framework). Combined with the built-in per-cell rollover notification should handle arbitrarily complex scenarios.
Jeanette
@gili no you can’t, using something under the gpl means you have to license your code under a compatible license (which depends on the version of the gpl, so google will get you a complete list)
scenario 1.0+ is not gpl however, only the svn/0.6 is.
when/if javafx is opensourced, i think they’ll add the classpath exception to the gpl, which will allow the use case you describe.
Hi Kirill,
nice to see that your industrious nature produced yet another wonderful library (also, it’s nice that you put it under a liberal license – GPL essentially means that a piece of software is a no go for the project I am currently working in).
Best regards,
S.
Is trident running 100% within Swing (as in: you animate jcomponents) or does it have it own canvas? I only see Java2D stuff being animated in the video’s.
Tom,
Trident is an animation framework for Java applications, not only for Swing applications. It only provides a timeline engine to schedule and follow timelines and timeline scenarios. It does not have any rendering capabilities (a-la SceneGraph or Swash).
My natural inclination is to use Java2D / Swing for the demoes, but the rendering is in the test applications, not in Trident.
You can create timelines / timeline scenarios on any Java object, even in a headless mode.
Thanks
Kirill
Understood.