xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Lim <leo.lim....@fedex.com>
Subject setting attributes dynamically
Date Thu, 08 Mar 2007 22:59:57 GMT


Is it possible to set attributes (fill, stroke) dynamically?

The g elements in my svg file have already defined the stroke element as you
can see below,


<g id="Rudder_Trim_Knob">

<path i:knockout="Off" fill="#B2B2B2" stroke="#000000" stroke-width="0.9684"



            <path i:knockout="Off" fill="#F2F2F2" stroke="#000000"
stroke-width="0.9684" d="M175.799,166.63




With this setup, is it possible to call
target.setAttribute(SVGConstants.SVG_STROKE_ATTRIBUTE, "green");

I tried this one and nothing happened. However, when I removed the stroke
definitions above, I was able

to set it successfully using setAttribute.


But I want the stroke definitions to remain in my svg file as the image
would look ugly without them. That said,

is there a way to override the initial definitions of the stroke attribute?





Leo Lim

View raw message