Re: Complex sequences

  • From: Kirill Grouchnikov <kirillcool@yahoo.com>
  • To: dev@trident.kenai.com
  • Subject: Re: Complex sequences
  • Date: Fri, 27 Nov 2009 14:19:42 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=ogKjKlQM0u2xHiRZH0jW+dXsKWCrABnwKEkkmvnTIIinM0WM1/qsIc37J+QQTS1NQfiToQ/0LZ2zf9UrWeVsSPhVHcOeZk1BO4sePwAe65Iwkqt+YY8X5DrPXDZNwLlIHWyYHYrEsU/bU1DoiA0NO8/oWrJmlCzyXyCmJOqfy0w=;

Hi Remy

Trident's APIs are reflecting my current understanding of the domain. So i indeed aim to make simple cases easy, but most certainly i do want to address more complex requirements.

Over these last two weeks i have been thinking about your use cases, and i don't see a clean API / implementation solution.

Right now, the timeline scenarios allow you to say that you want timeline B to start only when timeline A is done (simplifying these to timelines). And, you cannot have the same timeline run twice at different times in the same scenario.

It looks like you want a much more relaxed definition of a scenario, where you can mix timeline dependencies with arbitrary / freeform placement of timelines to start at arbitrary times. This is certainly doable, as long as the following conditions are met:

1. Invocations of the same timeline do not overlap
2. If a timeline appears more than once in the scenario, there is no other timeline / actor that depends on it
3. If a timeline depends on another timeline, it cannot be scheduled to play at the specific time

I might be missing other cases where the dependencies clash with freeform placement, but i think that you can understand the challenges in implementing such a freeform scenario.

I have been trying to think of a complete freeform scenario API - a new TimelineFreeformScenario class that will allow you to only add timelines and play them at the specified times, along with allowing playing the same timeline multiple times. However, such a class will not provide an API to create dependencies between the timelines.

Is this something that you had in mind?

Thanks
Kirill


From: "remy.rakic@gmail.com" <remy.rakic@gmail.com>
To: dev@trident.kenai.com
Sent: Thu, November 12, 2009 3:22:16 PM
Subject: Complex sequences

Hey Kirill :)

Continuing our twitter discussion over a more appropriate channel.

So I believe right now, Timelines and Scenarios are a little 'raw',
they support simple cases very well but I'm not sure how to do complex
cases.

My first use case is this: Let's say I have a default button in a
screen. I have an animation that  emphasizes this button is the default
one, and I want to play it a number of times at specific intervals. The
intervals can be static (at 1.5, 2, and 3s in the scenario - because it
just looks cool that way) or dynamic (calculated in regards to
application state, like the longer this screen has been showing, the
shorter the intervals; or the closer the mouse is to the button the
closer the intervals). It doesn't really matter. I also want to play
the same animation when the mouse rolls over the button. I could do
that by creating as many copies of the same timeline as I wanted to
play, but really I'd want to be able to schedule an animation when I
want it, not duplicate code or memory. I'd want an offset inside a
scenario, and being able to add the same timeline with different
offsets to a scenario if I needed to. The initial delay allows control
over the timing of one timeline inside one scenario, the offset allows
control over the timing of multiple animations (possibly the same one
being added multiple times at different offsets) inside one or more
scenarios (adding the same timeline at different offsets in different
scenarios). It increases the ability to reuse a timeline, because it
decouples the when (offset + initial delay) from the what (the
properties being animated).

Another use case:. I have a complex animation, that effectively
requires multiple timelines in a scenario, that I use to animate items
in a list. (Specifically the animated elements of an item are an image,
a label, some text (which I want to animate line by line), a group of
labels, and finally a group of images. All those are independently
fading in or out and being moved into place or resized). Some of those
are pretty complex already that I'd like to group them into scenarios
but let's say I just manage with one scenario and multiple timelines.
Now I want to animate every item (we can forget about delaying each one
a little because I talked about offsets just before, but in my case
they are each starting at a different time, even though it's the same
scenario. Here the initial delay would work as well). I can create as
many scenarios as the number of items, but how do I play them, do I
iterate over a list of scenarios and call play ? Are they really going
to be synchronized and start at the same time if I have many items ? I
hope so but I can't know for sure. But this is only one animation (one
transition to be exact) not many, I might need to pause this, play it
multiple times or in a loop, what I'd want is only one scenario, one
play() call, and have those scenarios be sub-scenarios to this main
scenario. Once again it increases reusability, of scenarios here,
because it allows them to be composed (+ the gains we saw earlier about
timing).

All in all, API wise this might only be one offset parameter on
Scenario.addTimeline, and Scenario implementing/extending ScenarioActor
?

It's probably more understandable like this than in 140 characters
right ?

What do you think ?
Take care.
Rémy



Complex sequences

remy.rakic 11/12/2009

Re: Complex sequences

Kirill Grouchnikov 11/27/2009

Re: Complex sequences

R?my Rakic 11/27/2009
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close