xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Rowlands <and...@madcore.com.au>
Subject Dynamic changes from javascript for text, textPath (xlink:href) and paths
Date Mon, 28 Jun 2010 01:07:50 GMT
Hi all,

I'm new to Batik (and Java for that matter).  I'm trying to make a 
flexible applet that I can change various properties of a loaded SVG via 
javascript functions (not ECMAscript functions in the SVG file itself 
but JS functions in the HTML file that the java applet is embedded in).

How it currently works:

In my java applet (using JSVGCanvas) there is a function 
updateElement(), which basically does:
Element elem = doc.getElementById(element_id)
elem.setAttributeNS(null, attribute, value).

This is called in javascript/HTML land by:

myObject = document.getElementById(id_of_applet);
myObject.updateElement("svg_element_id_to_update", "fill", "yellow");

It works great for the properties I can easily reference (e.g. fill, 
stroke, opacity) etc. but I'm struggling trying to dynamically change 
things like text content, xlink:href for textPath to change to a 
different path and/or updating a path definition.

Can anyone shed any light on the java required to change the contents of 
the text field, the textPath xlink:href and path definitions?

I have tried the obvious things (e.g. using my function above in the 
case of textPath xlink:href and path definitions), but seem to be 
missing something...

Many thanks,

Andy




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message