This bean was made by request, but is released as Open Source (FreeBSD License), it is compatible with Servoy developer and smart client but NOT web client.

It works in Servoy 4.1.x and Servoy 5+ for Windows and Mac and should work on Linux OSes (not tested).
A lighter version for Servoy 3.5.x (with no DataProvider support) could be done if there is enough interest to it.

The bean is capable of displaying any type of SVG graphics in a Servoy form.
SVG is an Open Source format that has the advantage of being vectorial, and that allows to create any kind of graphics, resolution independent.

In addition to simply displaying SVG files, the bean allows for scripting nodes by adding callback on click, and allowing to move SVG nodes and capture coordinates by using special object called MouseTrackers.

You will have to look at the sample solution to see what you can do with it and how it can be done.

In the SVG canvas, if allowUserInteractions is true, you can:

  • Zoom In: using ctrl (or cmd on Mac) + I
  • Zoom In: using ctrl (or cmd on Mac) + right mouse to drag a zone
  • Zoom Out: using ctrl (or cmd on Mac) + O
  • Reset the canvas: using ctrl (or cmd on Mac) + shift + right click
  • Real time zoom: using shift + right mouse drag
  • Panning: using shift + left mouse drag

The SVGBean is using the Apache Batik framework to interact with SVG Files, see http://xmlgraphics.apache.org/batik/ for more info on this library (Apache 2.0 License).

To install, you will have to download the SVG_install.zip archive which contains 2 folders: /beans and /plugins + a sample solution.

You will need to copy the content of these 2 folder into their respective Servoy folder :
  • /beans/svg_bean.jar in your servoy/application_server/beans
  • /plugins/svg_plugin.jar /plugins/svg_plugin.jar.jnlp and /plugins/svg_plugin/ in your servoy/application_server/plugins

To import the sample solution in Servoy, you will need to define an empty "svg_test" datasource.

Note that I only tested this one on Servoy 4.1.x and 5.x on Windows and Mac but it should work fine in Linux since it doesn't use anything else than pure Java and the compilation has been targeted for Java 1.5. If you find any problem on your platform, please open a new issue with all the relevant platform details.