How can i find out if there is already a transition running on the node – for example a FadeTransition ?
How can i find out if there is already a transition running on the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Thank you for your help. I want to share the solution that i’ve choosen finally for my specific problem. Its the following: I wanted to fade a node on mouse click. When a lot of clicks appear, a new
FadeTransitionshould only start when the current one is finished to prevent flickering or other phenomena.My approach can be seen in the first line of the function:
In this case,
ftis a private field of the typeFadeTransitionwhich is instantiated once within an “init” function. According to the JavaFX docs,getCurrentRate()returns0.0when the transition is paused or stopped. I don’t need to pause the transition, so this is the way to go for me – i’m just checking the value and let my transition play again when it’s stopped.