I'm working on an application to model some problem specific 2D geometry. And of course i would like to draw that geometry on the screen for the user to actually see it.
JavaFX has some 2D shapes like rectangles, ellipses, etc. It also has cubic and quartic curves, implemented as Bezier curves. Searching for custom shapes didn't help, since all I found was examples of taking some shape elements like paths and putting them together to draw a custom shape, like a heart or diamond. Searching for information on how to implement a new shape by extending the Shape class was even less helpfull.
What I want to draw are B-Spline curves of arbitrary order and length. I know how to calculate and implement the Splines itself, but i don't know how to implement them as a new Shape, or a Shape Wrapper.
I looked at the source code of JavaFX and the documentary. It seems as if those shapes are some kind of wrapper classes themselves. E.g. the Ellipse class contains an ellipse as member, which is part of the geometry package. This recursion goes pretty far.
Now there has to be some kind of method JavaFX uses to actually draw the curve, but I couldn't find it.
So how do I extend a JavaFX Shape to create e.g. a Spline class? What methods/classes are the key for Java to draw it?
I hope someone can help me.
Yours sincerely Thorsten