TitledPane-like Animation
cshNov 22 2011 — edited Nov 23 2011Hi,
I have a VBox with some nodes.
Now I want to "hide" one of those nodes by using an animation, very similar to the TitledPane.
====================
Node 1
====================
Node 2
====================
Node 3
====================
Node 2 should get collapsed.
I started with (on the Node 2):
TranslateTransition translateTransition = new TranslateTransition(Duration.seconds(1), this);
translateTransition.setToY(-this.getHeight());
translateTransition.play();
It kind of works. Node 2 moves to the top. But I there are still a few problems:
- Node 2 now overlaps Node 1. (but it should of course be the other way round).
- The space in the VBox is still reserved.
- Node 3 (and other content) should move according to the Interpolator which is used for the Transition.
How can I approach this?