Do Transitions really need to be final?

Michael Heinrichs michael.heinrichs at oracle.com
Mon Dec 19 04:22:30 PST 2011


Hi Dan,

the Transition classes are final, because they were not designed to be extended.

There is a request in JIRA to add more events to Animation, which would introduce them also in all Transition classes. Can you please take a look and comment on which events you are missing. http://javafx-jira.kenai.com/browse/RT-14455

The suggested way to add custom transitions is to extend the Transition class (there is an example in the JavaDocs). I have to admit though, that this story is not finished yet, because of the missing events. Hopefully I will be allowed to add them in the 2.1 release.

Thanks,
Michael



On 17.12.2011, at 08:25, Daniel Zwolenski wrote:

> Hey Guys,
> 
> Just wondering if there is a reason for the various transition classes
> (FadeTransition, PathTransition, etc) being final? I'm guessing it's some
> sort of performance thing but I can't really see it.
> 
> The reason I ask is because I just went to create a FadeTransition that
> also implemented a custom interface (in my case EntryTranstion, which has a
> setupBeforeAnimation method on it, and a few other things) and discovered I
> couldn't.
> 
> I could also see it being useful to be able to extend transitions to form a
> library of transition classes. I could use a factory, but it would seem
> more inline with what's there if I could create a CircularPathTransition
> that extended PathTransition, etc.
> 
> Cheers,
> Dan



More information about the openjfx-dev mailing list