[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Dynamic changes from javascript for text, textPath (xlink:href) and
From:       Andrew Rowlands <andrew () madcore ! com ! au>
Date:       2010-06-28 1:07:50
Message-ID: 4C27F5E6.30807 () madcore ! com ! au
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic