SnapSVG for Java

SnapSVG is a very decent JavaScript library for rendering and animations. With great delight the DukeScript project announces immediate availability of the library for all Java users!

Check the javadoc for detailed description. Use following code to add the SnapSVG into your DukeScript application:

Paper s = Exports.Snap("#demo");
Element bigCircle = s.circle(150, 150, 100);
bigCircle.attr(values(
    "fill", "#bada55",
    "stroke", "#000",
    "strokeWidth", 5
));

Element smallCircle = s.circle(100, 150, 70);
Element discs = Element.$as(s.group(smallCircle, s.circle(200, 150, 70)));
discs.attr(values(
    "fill", "#fff"
));

bigCircle.attr(values(
    "mask", discs
));

smallCircle.animate(values("r", 50), 1000);

See the example in our Definitely Typed Java libraries project. Enjoy SVG!