SVGElement gi = ((GraphicsCreator)child).createGraphic();
if(gi instanceof SVGElement) {
defs.appendChild((SVGElement)gi);
- String id = ((SVGElement)gi).getId();
- if(!id.equals("")) {
+// String id = ((SVGElement)gi).getId();
+// if(!id.equals("")) {
// defs.put(id, gi);
- } else {
+// } else {
// no id
- System.err.println("WARNING No ID for defs element : " + gi);
- }
+// System.err.println("WARNING No ID for defs element : " + gi);
+// }
}
}
}
ggraphic.setTransform(((SVGTransform)this.properties.get("transform")).getTransform());
ggraphic.setStyle(((SVGStyle)this.properties.get("style")).getStyle());
ggraphic.setId(this.properties.get("id").getString());
+ ggraphic.setClassName(new SVGAnimatedStringImpl(this.properties.get("class").getString()));
int numChildren = this.children.size();
for (int i = 0; i < numChildren; i++) {
FONode child = (FONode) children.elementAt(i);
if(child instanceof GraphicsCreator) {
SVGElement impl = ((GraphicsCreator)child).createGraphic();
- if(impl != null)
+ if(impl != null) {
+ if(impl instanceof SVGElementImpl)
+ ((SVGElementImpl)impl).setClassName(new SVGAnimatedStringImpl(((FObj)child).getProperty("class").getString()));
ggraphic.appendChild(impl);
+ }
} else if(child instanceof Defs) {
// System.out.println(child);
// ggraphic.addDefs(((Defs)child).createDefs());
FONode fo = (FONode) children.elementAt(i);
if(fo instanceof GraphicsCreator) {
SVGElement impl = ((GraphicsCreator)fo).createGraphic();
- svgArea.appendChild((org.w3c.dom.Node)impl);
+ if(impl != null) {
+ if(impl instanceof SVGElementImpl)
+ ((SVGElementImpl)impl).setClassName(new SVGAnimatedStringImpl(((FObj)fo).getProperty("class").getString()));
+ svgArea.appendChild((org.w3c.dom.Node)impl);
+ }
// } else if(fo instanceof Defs) {
// svgArea.addDefs(((Defs)fo).createDefs());
}
import org.apache.fop.dom.svg.*;
import org.apache.fop.dom.svg.SVGArea;
+
+import org.w3c.dom.svg.*;
+
/**
* class representing svg:Style pseudo flow object.
*
super(parent, propertyList);
this.name = "svg:style";
}
+
+ String styleText = "";
+ protected void addCharacters(char data[], int start, int length)
+ {
+ styleText += new String(data, start, length - start);
+ }
+
+ public SVGElement createGraphic()
+ {
+ SVGStyleElement sse = new SVGStyleElementImpl(styleText);
+// sse.setType(this.properties.get("type").getString());
+// sse.setMedia(this.properties.get("media").getString());
+// sse.setTitle(this.properties.get("title").getString());
+// sse.setStyle(styleText);
+ return sse;
+ }
}