xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Waroon <jack.war...@freemail.hu>
Subject SVG Animation testing question
Date Wed, 08 Apr 2015 10:17:06 GMT
Hello,
 I am trying to build a testing environment for SVG animation publishing and to evaluate Batik
for this task.
 For this I need to be able to walk through the DOM "scene graph" of SVG elements at a given
time (i.e. verifying all elements are at expected positions, with expected local transforms
or attributes etc.).
 I tried to set up SVG animation handling though I am not able to obtain any means to perform
this walkthrough.
 The initial code looks like this (some simplifications apply):String parser = "org.apache.xerces.parsers.SAXParser";
BatikParserFactory factory = new BatikParserFactory(parser, true); // own class to get a proper
XML/SAX parser
factory.setValidating(false);SVGOMDocument document = (SVGOMDocument) factory.createDocument("svg_animation_test_001.svg");TestUserAgent
userAgent = new TestUserAgent(); // from Batik&#39;s testing suite
SVG12BridgeContext bridge = new SVG12BridgeContext(userAgent);CSSEngine cssEngine = ((SVGDOMImplementation)
document.getImplementation()).createCSSEngine(document, bridge);SVGAnimationEngine engine
= new SVGAnimationEngine(document, bridge);
engine.setCurrentTime(2.0f);
 So at this point I have a SVG document that is parsed, DOM built and time set to 2 seconds.
However, I don&#39;t know how to obtain any instance allowing me to traverse through DOM
corresponding to the given time. I noticed SVGAnimationEngine has a method createDocumentRoot
returning TimedDocumentRoot which might be something similar to what I need, however this
method is protected and hence not accessible.
 Is there any client-side mean for inspecting DOM at a given time? Some class instance I can
get or callbacks I can register to?
 Thank you!
Jack

 
Mime
View raw message