Hi,

I would like to know how to handle animations with batik, especially the 
animate tag.

If I put the following svg code into an svg graphic and open it with a java 
application with batik all works just fine and it'll be animated:

<rect x="100" y="100" width="500" height="500">
        <animate attributeType="CSS" attributeName="opacity" 
calcMode="discrete" 
from="1" to="0" dur="1s" repeatCount="indefinite" />
</rect>


But what do I have to do, if I want to do exactly this during runtime?

I've tried this:


SVGOMAnimationElement animate = (SVGOMAnimationElement) 
this.svgDocument.createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, 
SVG12Constants.SVG_ANIMATE_TAG);
animate.setAttribute("dur", "1s");
animate.setAttribute("values", "0; 0; 1; 1");
animate.setAttribute("keyTimes", "0; 0.5; 0.7; 1.0");
animate.setAttribute("attributeName", "opacity");
animate.setAttribute("attributeType", "CSS");
animate.setAttribute("repeatCount", "indefinite");

rect.appendChild(animate);

animate.beginElement();


but this didn't get animated, so I've tried to use the SVGAnimationEngine, but 
I'm not sure how to use the addAnimation() method, or even if I need to do 
that:

SVGAnimationEngine aEngine = getSVGAnimationEngine();
aEngine.addAnimation((AnimationTarget) rect, 
SVGAnimationEngine.ANIM_TYPE_CSS, "?", "?", AbstractAnimation???);

How can I setup an AbstractAnimation?



Any help is very appreciated

Thanks in advance.

Kind regards,

Fabian

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to