I start developing a new application for a software components editor (more informations soon). So I built my visual using Inkscape (as usual). Then I asked myself how to import my svg objects into JavaFx. I saw Inkscape does offer to export your svg into JavaFx code, but for now only JavaFx1.3 script is supported, so unable to do it for my JavaFX2.0 business application… Well I was only half tempted by writing a JavaFX1.3 to JavaFX2.0 code converter…
What a good suprise to discover the SVGPath object in JavaFx ! It made my import work quite easy (not easier than if Inkscape generated it for me but….). I just use the Inkscape objects xml editor to copy the path informations as shown :
Then juste create a JavaFx SVGPath Object and fill the content attribute with what you’ve copied
I did not find out how to easily transform your SVG object fill information as available in the Inkscape xml editor into JavaFx. I might think of writing a small parser program that compute such information into code… For now I translated myself the fill information using JavaFx Painter.
If some of you have interesting informations about SVGPath in JavaFx, raise your hand !