JavaFX SVG Translator Preview

It'll take a few more days before we post the code to OpenJFX, but in the meantime here's a preview of the latest version of our SVG to FX translator. The translator converts an SVG document into a single JavaFX class. Each definition id in the SVG is converted into a method of the class that returns the JavaFX equivalent of that element. The generated class itself is an instance of the JavaFX class Node, which means it can be used anywhere in a JavaFX Canvas.

Having this translator makes it straightforward to incorporate graphics created in vector drawing tools into JavaFX programs.

The below demo program consists of an SVG browser that uses the translator to convert SVG into JavaFX source code and then compiles and executes the result. In addition, the browser lets you view the original SVG source as well as the translated JavaFX source.

You can drag URL's that point at SVG files from web pages into the SVG Browser's canvas. It's pretty sad to see how little quality vector artwork is available on the public internet. Anyway, below are a few examples for you to try:

Comments:

Not really a work of art but here is a timeline of web browsers from wikipedia:

http://upload.wikimedia.org/wikipedia/commons/7/74/Timeline_of_web_browsers.svg

After the translation the text is a bit of a mess.

Posted by some geek on June 24, 2007 at 05:57 PM PDT #

[Trackback] Chris Oliver: Here’s a few tests that produce unexpected results: 410 (text) atom (viewBox) bozo (???) mememe (use)

Posted by Sam Ruby on June 24, 2007 at 11:43 PM PDT #

There is a problem with UTF-8 encoded text ... for instance if I put e acute (é) I will get a text with 2 characters (I anticipate, this are the char matching the two bytes used in UTF-8 encoding for storing the character).

Posted by bjb on June 25, 2007 at 04:56 AM PDT #

There is openclipart.org but there library are offline for a while.

Posted by Nir Tayeb on June 25, 2007 at 06:56 AM PDT #

I must be getting old. I remember when the famous SVG tiger used to be the famous PostScript Tiger...

Posted by Harry on June 25, 2007 at 06:37 PM PDT #

The "Crystal Office Icons" come with the original SVG. LGPL license too.

http://www.oxygen-icons.org/nuno/CrystalOfficeIcons.tar.gz

Posted by aberrant on July 24, 2007 at 03:35 AM PDT #

There is a big hole in JavaFX.
Threading.
It seems from the language docs if you use "do" or "do later" you have to use Java classes and look after your own synchronization (and error returns).

This required a VERY skillful programmer.

What we need is threading and result synchronization that the 'average' programmer can use and access directly from the scripting language.

Posted by Matthew on September 13, 2007 at 12:29 PM PDT #

Hi..

Where is the source code populated?

I have trouble using the script code in my app. I like to see how it is done in the web start app..

Posted by Kasper on October 17, 2007 at 06:52 PM PDT #

Doesn't properly handle <text> elements that have transform attributes like this:

transform="matrix( ... )"

It just creates a text node in the Javafx w/o the transform.

Otherwise, great job!

Posted by Daniel Joyce on October 30, 2007 at 06:18 AM PDT #

excellent

Posted by sinema izle on August 24, 2008 at 08:04 PM PDT #

There is a big hole in JavaFX.
Threading.
It seems from the language docs if you use "do" or "do later" you have to use Java classes and look after your own synchronization (and error returns).

This required a VERY skillful programmer.

What we need is threading and result synchronization that the 'average' programmer can use and access directly from the scripting language.

Posted by forum on August 29, 2008 at 02:52 PM PDT #

It's too bad that the spaces between "Client" and "Server" were removed in my previous post

Posted by toner on September 03, 2008 at 09:12 AM PDT #

i think JavaFX need more time and development to get popularity. regards

Posted by Manual on April 07, 2009 at 06:26 AM PDT #

great. thanks

Posted by free service manual on May 01, 2009 at 01:41 AM PDT #

Perfect . Thanks

Posted by free service manuals on May 01, 2009 at 01:46 AM PDT #

There is a problem with UTF-8 encoded text ... for instance if I put e acute (&eacute;) I will get a text with 2 characters (I anticipate, this are the char matching the two bytes used in UTF-8 encoding for storing the character).

Posted by Full Download on May 17, 2009 at 06:52 AM PDT #

What we need is threading and result synchronization that the 'average' programmer can use and access directly from the scripting language.

Posted by Spor İddaa Yorum on May 17, 2009 at 06:53 AM PDT #

i think JavaFX need more time and development to get popularity. regards

Posted by Full indir program on May 17, 2009 at 06:53 AM PDT #

http://www.smsmatbaa.com

Posted by matbaa on June 22, 2009 at 03:07 AM PDT #

What we need is threading and result synchronization that the 'average' programmer can use and access directly from the scripting language?.

Posted by hotfile download on August 24, 2010 at 09:10 PM PDT #

wWhat we need is threading and result synchronization that the 'average' programmer can use and access directly from the scripting language?.

Posted by ClickDDL on September 25, 2010 at 04:24 AM PDT #

vereee good i think JavaFX need more time and development to get popularity. regard...

Posted by شات on September 26, 2010 at 12:56 PM PDT #

Simple and Nice example !

Posted by شات مصري on December 04, 2010 at 07:56 PM PST #

Simple and Nice example !

Posted by شات on December 04, 2010 at 07:56 PM PST #

Simple and Nice example !

Posted by دردشة on December 04, 2010 at 07:57 PM PST #

Simple and Nice example !

Posted by دردشة مصرية on December 04, 2010 at 07:57 PM PST #

be cool bro. thanks

Posted by Egitim on December 11, 2010 at 05:13 AM PST #

I will get a text with 2 characters

Posted by شات on December 15, 2010 at 03:30 AM PST #

Simple and Nice example !

Posted by منتديات on January 04, 2011 at 11:35 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

user12610627

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today