Community
Participate
Working Groups
Nebula currently handles SVG inside the o.e.n.cwt project. We would like to extract these classes into their own project and make the SWT/SVG library as complete as possible. AFAI could find, there are no real independent SVG implementations for SWT. * People use Batik to render SVG into an image and then display this image inside an SWT canvas. * GMF has some support [1] * Java Swing/AWT implementation [2] [1] https://git.eclipse.org/c/gmf-tooling/org.eclipse.gmf-tooling.git/tree/plugins/org.eclipse.gmf.runtime.lite.svg/src/org/eclipse/gmf/runtime/lite/svg [2] https://github.com/jfree/jfreesvg
Hi Wim How about embed JFreeSVG with SWT/AWT bridge ?
Another idea : embed a JavaFX WebView ?
I'm looking for a native SWT implementation. Edward expressed interest in working on this. Edward, let me know if you need some pointers to get started.
Ok I understand, I'll have a look this week to check if a port of JFreeSVG is conceivable.
(In reply to Laurent CARON from comment #1) > Hi Wim > > How about embed JFreeSVG with SWT/AWT bridge ? Thanks, Laurent! Maybe you can work with Edward? The plan is to move the existing svg support from cwt into its own widget.
I think a mix between JFreeSVG & SWT/AWT should be reasonable. Stay tuned ;)
(In reply to Wim Jongman from comment #3) > I'm looking for a native SWT implementation. Edward expressed interest in > working on this. Edward, let me know if you need some pointers to get > started. Wim, I am interested. I've never contributed to anything like this, so I am definitely interested in some pointers. Thanks.
(In reply to Edward Francis from comment #7) > (In reply to Wim Jongman from comment #3) > > I'm looking for a native SWT implementation. Edward expressed interest in > > working on this. Edward, let me know if you need some pointers to get > > started. > > Wim, I am interested. I've never contributed to anything like this, so I am > definitely interested in some pointers. Thanks. Hey Edward, sorry for the delay. If you take a look at the filestructure of Nebula, you will see that each project has its own directory inside the widgets directory. I think for now, we can create a new project o.e.nebula.cwt.svg inside the CWT widget that will be used to isolate the SVG code. Then we will need to add this new project to the CWT feature.
I worked on the subject. Unfortunately, JFreeSVG can only output SVG documents, it cannot render existing SVG files within Java application. If one wants to display SVG files in Java, the only solution is Apache Batik (SVGSalamender [1] is not an alternative because it has not been updated for years). I'll work on a SWT Control that embeb a Batik Control viewer (with SWT/AWT). Is there any legal issues ? (Apache Licence VS EPL 2) ? Cheers, Laurent [1] = https://github.com/blackears/svgSalamander
Laurent, please take a look at bug 568215
(In reply to Wim Jongman from comment #10) > Laurent, please take a look at bug 568215 Very intersting, thanks !
Simply providing a widget that shows/renders a SVG using batik is rather trivial. But SVG is more than a vector format, it allows styling via css (internal and external), animation and even live DOM manipulation. All this makes it very hard to write a feature complete library (even batik is not feature complete!). So if one really likes to support an "SVG Widget" it should at least support basic interaction (something similar to what Inkscape does). I have written a very basic SWT Render for Batik, but the SWT GC is just to limited to support some of the SVG features so a lot of things have to be emulated. So from my point of view it makes sense to simply render the SVG into BufferedImage and the display thins inside some kind of SWT Widget that support all the other fancy stuff. There is one alternative (even though I never have never evaluated it): As SWT allows to integrate native widgets and Inkscape is available for Win/Linux/Mac it MIGHT be possible to create some kind of integration with inskcape using as a renderer as well. So in my opinion, the very first question should be: What should this SVG support? - plain rendering/scaling of static svg? - should DOM manipulation/CSS styl editing be supported (beside a simple "redraw all" operation - do we want interactions with the DOM (event handlers?) - do we need some kind of editing capability (SVG editor) - what about animation support all of these are non trivial tasks and writing it from scratch, so if anything is missing from Batik it makes more sense to contribute there.
Postponed to V2.6.0
Moved to Github : https://github.com/eclipse/nebula/issues/353