title: Timeline on rotating rectangle
body: <p>I need to make one action happen while animation is half way there. Like my rectangle is rotating 180 degrees on Y Axis. I need it to change the color when 90 degrees is done and make text visible when 180 degrees is done.</p>
  
  <p>I was told to use Timeline and add event handlers to the relevant key frames but I don't really know how. </p>
  
  <pre><code>public void open() {
    RotateTransition trans = new RotateTransition(Duration.seconds(1), rec);
    trans.setOnFinished(event -&gt; {
    text.setVisible(true);
    rec.setFill(Color.WHITE);
    });
    trans.play(); 
  }
  </code></pre>