Exposing Timeline's mainObject

  • From: Andres Almiray <aalmiray@yahoo.com>
  • To: dev@trident.kenai.com
  • Subject: Exposing Timeline's mainObject
  • Date: Sat, 5 Jun 2010 07:15:20 -0700 (PDT)
  • 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=JrspqQYgDqzm5UVBtbiAkaBySCPWkaJoefGnRXoszJVXouKeXlw1ZIb7tbfCet5Lj5+HjM4uICbH4MXCXxA92mm/ps/ywFxcIdGet7qQORQ8PH08+SX+5kWt5whle7jUG2RD21vKTmt1TRTdYzUHdJyni23OatKqUoWwhAUyeCY=;

Hi Kirill,

I've come across a use case where having read-only access to the Timeline's mainObject property would be a good thing to have.
Integrating Remi's triggers yields the following code for the animated button sample

  button("One", id: "button", foreground: Color.BLUE)
  timeline(button, duration: 2500) {
      mouseTrigger(button, event: 'enter', autoReverse: true)
      interpolatedProperty("foreground", from: Color.BLUE, to: Color.RED)
  }

While it is short and concise you can appreciate that the mouseTrigger() node must have a repeated entry for the button variable.
If access to Timeline.mainObject is possible then the trigger can read it from the parent Timeline, resulting in a DRY approach

  button("One", id: "button", foreground: Color.BLUE)
  timeline(button, duration: 2500) {
      mouseTrigger(event: 'enter', autoReverse: true)
      interpolatedProperty("foreground", from: Color.BLUE, to: Color.RED)
  }

What do you think? Worth having for 1.3?

Cheers,
Andres
 
-------------------------------------------
http://jroller.com/aalmiray
http://www.linkedin.com/in/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and those who don't.
To understand recursion, we must first understand recursion.



Improving SwingRepaintTimeline

Rob Eden 06/03/2010

Re: Improving SwingRepaintTimeline

Kirill Grouchnikov 06/04/2010

Re: Improving SwingRepaintTimeline

Rob Eden 06/04/2010

Re: Improving SwingRepaintTimeline

Kirill Grouchnikov 06/04/2010

Re: Improving SwingRepaintTimeline

Rob Eden 06/04/2010

Re: Improving SwingRepaintTimeline

Kirill Grouchnikov 06/04/2010

Re: Improving SwingRepaintTimeline

Rob Eden 06/04/2010

Re: Improving SwingRepaintTimeline

Kirill Grouchnikov 06/04/2010

Re: Improving SwingRepaintTimeline

Andres Almiray 06/04/2010

Re: Improving SwingRepaintTimeline

Kirill Grouchnikov 06/04/2010

Exposing Timeline's mainObject

Andres Almiray 06/05/2010

Re: Exposing Timeline's mainObject

Kirill Grouchnikov 06/06/2010

Re: Exposing Timeline's mainObject

Andres Almiray 06/07/2010
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close