Skip to main content

Animation: Footnotes, and Looking Ahead

Posted by editor on January 14, 2010 at 5:47 AM PST

Kirill Grouchnikov talks about the origins of his series of animations posts and looks ahead in his latest post Animations - footnotes. First, how did the series come about?

The animation series that was published on this blog last week has been largely the product of reworking the animation layer in Substance look-and-feel and replacing it with the Trident animation library.

So, when some people posted comments asking if they could see actual code that implements the laws of motion and other aspects of animation that Kirill was presenting, the response was that much of the code exists in the upcoming versions of Kirill's open source projects, specifically Trident, which is being integrated into Substance. But, since this is new code, developers who have existing applications that use these open source libraries may need to make some modifications to their apps, in order to take advantage of the new animation features:

If you're using Substance look-and-feel library in your applications, you will need to add the matching Trident jar to your classpath – starting from release 6.0 of Substance. The matching Trident version is 1.2 and it will be officially released at the same time with Substance 6.0. While this is not a major Trident release, it does remove deprecated APIs and as such will break applications that are using those APIs. All the removed APIs have direct replacements, and the final release notes will provide additional information (if you cannot find it in the code). The final Trident 1.2 / Substance 6.0 releases are scheduled for March-April 2010 timeframe.

In Animations - footnotes, Kirill talks a bit about the timing of state changes:

Suppose it takes 500ms to complete a single animation. The user moves the mouse over a button, and Substance starts animating the color from light blue to light yellow. Halfway through the animation (250ms), the user presses the button. Now, there are three states participating in the animation: default with light blue, rollover with light yellow and pressed with saturated orange. All the states contribute to the overall appearance of the button as long as the combined animation is in progress.

This brings up a very important issue for any application that applies animation: processing time and display time. A problem I've seen many times arises because developers tend to develop on fairly high-end computers, which are often much faster and more powerful than the computers that many users of the applications work on. This can lead to the development of complex animations that work very well on the developer's own system, but which bog down a user's system, which lacks the resources to perform the necessary computations and display the results in an adequate time frame, resulting in choppy, halting animations on the user's computer.

As Kirill noted early in the series, you probably have only one chance, and it's probably limited to less than a minute, to impress a new user. If you've created something that can only run properly on a high-end developer's system, but you're selling your application to a wide user base (perhaps through the Java Store), you've got to be careful not to let the excitement that comes with creating dazzling displays on your own system carry you away -- if, that is, your objective is broad distribution of your app.

Where this can become a real problem is situations where you have large numbers of animated objects all working within as single field of view. If all users had N-core computers (where N is the number of simultaneouly animated objects your app manages), it probably wouldn't be a problem. But even today, you have to assume that many users still have older single processor computers. If widespread distribution is your goal, I think you need to ensure that your application runs well on computers that were fairly mainstream in the consumer market 3-4 years ago.

Anyway, Kirill's animations series, which started with Animations 101 - from point A to point B, illustrated the complexity of real-world movement and state transitions. In Animations - footnotes, Kirill notes that a lot of work remains with respect to coding everything that was discussed in the series:

The current implementation of the multi-state transitions in Substance 6.0dev does not model most of the physical laws discussed in this series. Handling momentum / inertia, direction change involving smooth turns, and the matching velocity models are not implemented. The work on this will continue throughout 2010, and some of it might find its way to the Trident itself. I am not aware of any other animation library (Java based or otherwise) that provides out-of-the-box support even for simple animations based on the physical rules discussed in this series.

My guess is that volunteers who would like to assist in the effort will be welcomed!

In Java Today, Kirill Grouchnikov has posted Animations – footnotes as a finale (I think) to his recent animations series:

The animation series that was published on this blog last week has been largely the product of reworking the animation layer in Substance look-and-feel and replacing it with the Trident animation library. This work has some implications for the users of both library, and today i’m going to talk about those...

Bruce Hopkins has a new Sun Developer Network article, Deploying Servlets on Smart Cards: Portable Web Servers with Java Card 3.0:

No, that's not a typo. No, I'm not talking about technology that will be available 10 years from now. Java Card 3.0 technology is available today that allows application developers to create and deploy servlet applications on smart card devices. This article shows developers how to get started with developing servlets with the Java Card Connected Development Kit 3.0.2...

Danny Coward has Java ME MIDP 3.0 in hand:

ME MIDP 3.0 shipped recently
, and the Janitor has already one of
the developer phones in his hand as he writes (no jokes about one
handed-typing please), complete with battery, clock and Twitter href="">MIDlets and more. No
big deal, but its the MIDlet environment that's really changed. These MIDlets, which can now run href="">concurrently,
in the href="">background,
can start when
the phone boots

In today's Weblogs, Cay Horstmann comments on Project Stage and Openness:

One nice thing about JSF 2.0 is that they have taken good ideas from elsewhere, such as the “project stage” concept from Rails. If you set the project stage to ”development”, you get detailed error and warning messages. If you set it to “production”, you get more aggressive caching. Better diagnostics or better performance? The choice is yours, and that is good...

John Ferguson Smart announces the current Java Power Tools Bootcamps and TDD workshops for the first half of 2010:

We are finalizing plans for the Java Power Tools Bootcamps and TDD training sessions for the first half of 2010. Highlights include the upcoming London and Paris sessions of the Java Power Tools bootcamps, as well as many sessions Wellington, Sydney, Canberra and Melbourne...

Fabrizio Giudici writes about The Hierarchy API:

Tree-like structures are a very common pattern. Just to count instances of this pattern in my FLOSS projects: 1. The File Explorer in blueMarine, where photos are shown as they are stored in directories on the local disk. 2. The Calendar Explorer in blueMarine, where nodes representing year / month / day are shown for each day in which a photo has been taken. 3. The Metadata Explorer in blueMarine, where various metadata directories are shown (ok, this is a very shallow tree with only two levels). 4. The Catalog Explorer in blueMarine, where photo tags and tag categories are shown in hierarchical fashion....

In the Forums, ymikhel asks about Package com.sun.xml.wss.saml javadoc?: "Hi, There are differences between the documented methods in the package com.sun.xml.wss.saml (Assertion class methods, for the example) and the methods exposed by the real class (for example getID() method is not documented). Is there any updated javadoc for that package? ..."

bsevindi has a Locale Problem of j_security_check: "Hello, I am using form based authentication against an ldap realm. Login operations fail with users that have Turkish characters in their user names..."

ronanoc seeks help with Thread priorities: "Hi all, could Chen / Shai or other comment on recommended thread priorities to have a good animated UI where networking is going on in the background? How can I set the priority of the EDT etc..."

Our current Spotlight is Christopher Lam's How to Create a Scheduler Module in a Java EE 6 Application with TimerService: "Many a time, in a Java EE application, besides the user-triggered transactions via the UI (e.g. from the JSF), there's a need for a mechanism to execute long running jobs triggered over time, e.g., batch jobs. Although in the EJB specs there's a Timer service, where Session Beans can be scheduled to run at intervals through annotations as well as programmatically, the schedule and intervals to execute the jobs have to be pre-determined during development time and Glassfish does not provide the framework and the means to do that out-of-the-box. So it is left to the developer to code that functionality or to choose a 3rd party product to do that..."

Our current Poll asks Which Java EE 6 enhancement is most significant? Today is the last full day of voting.

We've just published a new Feature Article, Maven Repository Managers for the Enterprise, by John Smart. We're also featuring Jeff Friesen's Reading Newsfeeds in JavaFX with FeedRead, in which Jeff demonstrates how to apply JavaFX's RSS and Atom newsfeed capabilities to create a snazzy little JavaFX app that can run stand-alone or in a browser.

The latest Java Mobility Podcast is Java Mobile Podcast 92: MIDP 3.0 in Depth: Tutorials and Demonstrations: Excerpts from the JavaOne 2009 MIDP 3.0 In Depth: Tutorials and Demonstrations session with Roger Riggs, Lakshmi Dontamsetti and Stan Kao.

Current and upcoming Java Events:

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

-- Kevin Farnham

O'Reilly Media