When I was creating the prize draw application I needed to work out the Spline interpreter numbers to make the names thud down. I ended up using Romain Guy’s Spline Editor for Swing which makes it nice and easy. So thought it was about time we had a JavaFX version, and it could not be too hard. So a couple hours and a couple hundred bind statements later we have a very cool little Spline Editor that lets you edit the spline and see the effect in real time then copy the code to paste into your JavaFX application.
If you would like to try it for your self click here: you can also download the source Netbeans project.
Sorry for the duplication if as my avid readers will have seen my Devoxx 2008 post with the same app. I am just starting a new JavaFX Applications category so I wanted to split this out into its own post. There are some new apps coming so don’t worry 🙂
Very nice application. Can you please name the coordinates also, I need to go and see in the API what it is doing 🙂
Vaibhav can you explain exactly what you want named for the coordinates?
Can you extend the bounds to support negative numbers (overshoot and bounce effects)?
Thanks,
Dave
Dave: I had already wanted to do that but unfortunately the JavaFX API does not support that. I will have to raise a feature request on that 🙂
Very cool. You should draw the attention of the edu guys to this example.
Hi Jasper,
So I used this on the Google Android platform.
I ported the TimingFrameworks SplineInterpolator (https://timingframework.dev.java.net/source/browse/timingframework/src/org/jdesktop/animation/timing/interpolation/SplineInterpolator.java?rev=1.2&view=markup) to be compatible with Android. Android has an animation/interpolation mechanism that has very similar concepts. Even the Interpolator interface is almost the same contract (hence the porting of SplineInterpolator was dead simple).
I then use your outputter to generate the values that I pump into the interpolator. It works beautifully! Any chance you can have more interpolation points for a more complex curve? (maybe to simulate a bounce for example in 1 curve which would involve being able to move backwards). That would be the logical next step. Ofcourse the math in the spline interpolator will be a lot more complex as well.
Regards,
Nik Bhattacharya
Cool app! However, “Copy” is broken for Russian locale as it generates the following: Interpolator.SPLINE(0,800,0,200,0,200,0,800)
Totally awesome and useful.
Thank you!