Skip to main content

[Timing Framework] - A little help here...

3 replies [Last post]
ricardolexix
Offline
Joined: 2012-04-19
Points: 0

Hi.

I'm new here. Nice to meet you guys. Well, recently I've been reading the famous book filthy rich clients, and I'm worried about it being outdated. In fact, I would like to use the new version of the timing framework, but unfortunately I have had serious problems to be able to use it, and it's driving me half crazy. So I did a message to the people who developed this framework, and would like some response to direct me to a direction:

Hello team working on project timing framework. I currently study the book filthy rich clients and realized that you updated the framework. Now I no longer make use of the Animator class because I'm having problems with it. I'm desperate and need help. Every time I use the Animator class, I get a exception like this:

Exception in thread "main" java.lang.IllegalArgumentException: (Timing Framework # 11) for this TimingSource AnimatorBuilder must be non-null. Did you forget to set the default timing source?

My class which implements the interface TimingTarget is never called! How do I use the class TimingSource and what should I do to have the same comfort as before when using the previous version of Animator class?

NOTE: I would like to suggest something to you. Besides the proper documentation which comes with the framework, would be more interesting that you also do a tutorial teaching how to use and create simple animations, using TimingTarget, Animator and talking about TimingSource.

Thank you,

Ricardo.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ricardolexix
Offline
Joined: 2012-04-19
Points: 0

Oh, I forgot to say one thing ... I've tried to create the Animator object like this:

Animator animator = new Animator.Builder(new SwingTimerTimingSource()).
AddTarget(this).
setDuration(500 , TimeUnit.MILLISECONDS).build();

animator.start ();

And nothing happened. The method timingEvent in my class that implements TimingTarget was not called.

Ricardo.

Behnil
Offline
Joined: 2012-04-26
Points: 0

Hi ricardolexis,

you have to init the timig source
TimingSource.init()

ricardolexix
Offline
Joined: 2012-04-19
Points: 0

Behnil wrote:
Hi ricardolexis,

you have to init the timig source
TimingSource.init()

Hi.

I just want to say thank you and also explain how this could actually work, because after I got a lot of this problem, I discovered how to make it work. So, here's how things are made:

The Animator class utilizes a mode chosen by the programmer to pass the time of the animations, to choose who will count the time and animate them. In previous versions it was seen that the use of various objects to animate javax.swing.Timer separately each animation was very expensive. So the team that takes care of the project decided to create a single Timer object, which is one way to pass animations, and let it be running, or passing. As the programmer creates objects Animator, he can choose this Timer object ever created, and pass it to each Animator use it properly.

There is a static mode of choice for each Animator created for it already know that Timer object has been created and that this should be used:

Animator.setDefaultTimingSource (TimingSource ts);

The implementation that was designed to reproduce the time with the use of the object javax.swing.Timer, is made by the class SwintTimerTimingSource. For each object Animator can start your own animation properly, it is necessary that an object SwingTimerTimingSource is playing. For this to happen, just call the init method of SwingTimerTimingSource.

Again, i want to say thanks for the help. I think this is a great/fantastic framework, and also think it should be popularized. Unfortunately, there is not much didatic documentation to study. I've tried talking with the creators of this framework and begged that they would be kind enough to create an explanatory documentation. I hope they have at least thought about it. Well, that's it. For now i'm accomplishing my projects. I hope i have helped too.

Thank you all!

Ricardo.