Hi Rick, Seems to me like multiple onFinished event handlers [1]. The first comment there lists a plan for multiple event handlers in general.
[1] https://bugs.openjdk.java.net/browse/JDK-8091406 On Tue, Sep 11, 2018 at 4:07 PM Rick Walker <thoughtslin...@gmail.com> wrote: > Dear Nir, > > Please forgive me if I am not following protocol - I rarely contribute to > this mailing list. > > I find myself constantly wrapping an animation within a ParallelTransition > or SerialTransition so that setOnFinished can be called twice - once for > the core animation and again by higher level code. > Can you figure out a way to do this in a cleaner, simpler way? > > Like this: > > public Animation getFadeOut() > { > // create a transition to fade out this node > FadeTransition fade = new FadeTransition(Duration.millis(300), this); > fade.setFromValue(this.getOpacity()); > fade.setToValue(0); > > // when complete, do something > fade.setOnFinished(e -> { /* do something here */ }); > > // wrap the fade out transition so that the caller of this method can > separately call setOnFinished() > ParallelTransition pt = new ParallelTransition(); > pt.getChildren().setAll(fade); > return pt; > } > > Best regards, > Rick Walker > > > On Tue, 11 Sep 2018 at 04:54, Nir Lisker <nlis...@gmail.com> wrote: > >> Hi Brian, >> >> Thanks for the input. How is "starting" different from "started" etc.? >> >> On Mon, Sep 10, 2018 at 6:23 PM Brian Hudson <brian.r.hud...@gmail.com> >> wrote: >> >> > I would love to see "Animation needs more events" resolved [1]. >> > >> > Maybe following events: started, paused, resumed, cycleStarted, >> cycleEnded, >> > stopped/ended? These additional life cycle events would allow me to do >> some >> > things with animations/transitions that I've been struggling to do. >> > >> > There may even be use cases events for starting, pausing, resuming, >> > cycleStarting, cycleEnding, stopping/ending. >> > >> > [1]: https://bugs.openjdk.java.net/browse/JDK-8092408 >> > >> > > > -- > Richard P. Walker > thoughtslin...@gmail.com > > This email is intended only for the use of the individual(s) to whom it is > addressed and may be privileged and confidential. Unauthorised use or > disclosure is prohibited. If you receive this e-mail in error, please > advise immediately and delete the original message. This message may have > been altered without your or our knowledge and the sender does not accept > any liability for any errors or omissions in the message. > > Ce courriel est confidentiel et protégé. L'expéditeur ne renonce pas aux > droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou > copie de ce message ou des renseignements qu'il contient par une personne > autre que le (les) destinataire(s) désigné(s) est interdite. Si vous > recevez ce courriel par erreur, veuillez m'en aviser immédiatement, par > retour de courriel ou par un autre moyen. >