Hello, after good progress due to your last tips (thanks again), I have encountered another problem: Trying to set a text color, which I thought to be one of the easiest of tasks. I wrote this code:
public void setTextColor(SVGGElement element, Color color) { NodeList list = element.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { if (list.item(i) instanceof SVGTextElement) { ((SVGElement) list.item(i)).setAttribute("fill", "rgb("+ color.getRed()+ ","+ color.getGreen()+ ","+ color.getBlue()+ ")"); } } }
After some initial hindrances were quickly solved by use of the SVG specification, everything
seemed to be in order to me, but things still are not working: Upon calling the method, the text simply
disappears. Using the Eclipse debugger, I had a look into the object structure, and noted that the SVGTextElement
has no direct "fill"-attribute, instead, the color value seems to be stored in a "ComputedStyleMap" - which
I don't know how to access.
'.hasAttribute("fill")', however, returned true when called and '.getAttribute("fill")' confirmed that
the fill attribute was set to the RGB-value I specified.
What bothers me is that a mostly identical piece of code is used to set an area's background-color and works perfectly well - do you know of a way to solve this?
Thank you -Urs
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]