JavaFX Spline Editor

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.

Spline Editor

If you would like to try it for your self click here: you can also download the source Netbeans project.

 

8 Responses to “JavaFX Spline Editor”

  1. Jasper Potts Says:

    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 :-)

  2. Vaibhav Says:

    Very nice application. Can you please name the coordinates also, I need to go and see in the API what it is doing :)

  3. Jasper Potts Says:

    Vaibhav can you explain exactly what you want named for the coordinates?

  4. David Walend Says:

    Can you extend the bounds to support negative numbers (overshoot and bounce effects)?

    Thanks,

    Dave

  5. Jasper Potts Says:

    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 :-)

  6. Octavian Tanase Says:

    Very cool. You should draw the attention of the edu guys to this example.

  7. JavaFX Links (3) « Java and more … Says:

    [...] a spline editor in JavaFX. With copy and paste option to use the code in your next JavaFX [...]

  8. Nik Says:

    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

Leave a Reply