Hi everybody!
 
I have a problem to fill elements of a group. I tried the following:
 
if (elemToMark.getTagName().equals("g")) {
     System.out.println("Group found: " + elemToMark.getId());
     
     elemToMark.setAttributeNS(null, "stroke-width", "6.0");
     elemToMark.setAttributeNS(null, "stroke", "black");
     elemToMark.setAttributeNS(null, "fill", "blue");
}
 
I noticed, that setting the stroke attribute works, but not filling
the elements of the group....
 
I also had the idea to loop over all elements of the group, but
I had some problems to get the SVGElements from the group,
I just get the Nodes....
 
for (int i = 0; i < size; i++) {
      Node node = nodeList.item(i);
      SVGOMElement child = (SVGOMElement) node;
      child.setAttribute(....)
 
 
.... and end up in a ClassCastException if I try this (of course).
Is there a proper way to change the attributes of the elements
of a group?
 
 
Thanks in advance,
 
Christoph

Reply via email to