Hi Andre,

André Wiesnewski <[EMAIL PROTECTED]> wrote on 01/16/2007 12:49:51 PM:

> I?m working on a graph visualization tool for molecules with the 
> toolkits batik and picollo.
> Everything is fine, but i want to change the stroke width of the given 
SVGs.
> When I zoom out the strokes of the SVG Nodes are to thin.
> Is this possible to change them with Batik without editing the XML?

   Yes, I assume you will want to do this from Java, so make sure
to tell the canvas to be dynamic:

    http://xmlgraphics.apache.org/batik/faq.html#display-does-not-update

   The you can adjust the stroke-width with something as simple as:

        SVGDocument doc = canvas.getSVGDocument(); // canvas is your 
JSVGCanvas
        SVGSVGElement root = doc.getRootElement();
        root.setAttributeNS(null, "stroke-width", "10");

   In this case the change in stroke width will cascade down the
rendering tree (for your very simple SVG document this might work
for you). 

   If you needed/wanted to only adjust the line elements
you might use DOM calls like getElementsByTagNameNS, or iterate
through all the children of the root with getFirstChild() and
getNextSibling() methods.

> The SVG:
> 
> <svg width="200" height="200" >
> <rect fill="none" x="0" y="0" width="200" height="200" />
> <line x1="66" y1="107" x2="66" y2="133" stroke="rgb(0, 0, 0)" />
> <line x1="61" y1="111" x2="61" y2="129" stroke="rgb(0, 0, 0)" />
> <line x1="66" y1="133" x2="81" y2="141" stroke="rgb(0, 0, 0)" />
> <line x1="97" y1="141" x2="111" y2="133" stroke="rgb(0, 0, 0)" />
> ...


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to