aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/svg
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2000-09-11 03:12:02 +0000
committerKeiron Liddle <keiron@apache.org>2000-09-11 03:12:02 +0000
commit37b387a2a2588af298d201ef99e55a223520e4c7 (patch)
tree8f0a4dc9c1ecbd721336b273e785d5c55028ada7 /src/org/apache/fop/svg
parentbd984eda96a02fb39a51c679ddee322c4d287741 (diff)
downloadxmlgraphics-fop-37b387a2a2588af298d201ef99e55a223520e4c7.tar.gz
xmlgraphics-fop-37b387a2a2588af298d201ef99e55a223520e4c7.zip
handles style, class name
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193688 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/svg')
-rw-r--r--src/org/apache/fop/svg/Defs.java10
-rw-r--r--src/org/apache/fop/svg/G.java6
-rw-r--r--src/org/apache/fop/svg/SVG.java6
-rw-r--r--src/org/apache/fop/svg/Style.java19
4 files changed, 34 insertions, 7 deletions
diff --git a/src/org/apache/fop/svg/Defs.java b/src/org/apache/fop/svg/Defs.java
index 362bf8c9f..8ee14015e 100644
--- a/src/org/apache/fop/svg/Defs.java
+++ b/src/org/apache/fop/svg/Defs.java
@@ -120,13 +120,13 @@ public class Defs extends SVGObj {
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);
+// }
}
}
}
diff --git a/src/org/apache/fop/svg/G.java b/src/org/apache/fop/svg/G.java
index f857a91f1..81e949e50 100644
--- a/src/org/apache/fop/svg/G.java
+++ b/src/org/apache/fop/svg/G.java
@@ -114,13 +114,17 @@ public class G extends SVGObj {
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());
diff --git a/src/org/apache/fop/svg/SVG.java b/src/org/apache/fop/svg/SVG.java
index 6ddd4d2d3..e8067faaf 100644
--- a/src/org/apache/fop/svg/SVG.java
+++ b/src/org/apache/fop/svg/SVG.java
@@ -132,7 +132,11 @@ public class SVG extends FObj implements GraphicsCreator {
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());
}
diff --git a/src/org/apache/fop/svg/Style.java b/src/org/apache/fop/svg/Style.java
index 0efe1e8a0..676ec7b56 100644
--- a/src/org/apache/fop/svg/Style.java
+++ b/src/org/apache/fop/svg/Style.java
@@ -59,6 +59,9 @@ import org.apache.fop.apps.FOPException;
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.
*
@@ -103,4 +106,20 @@ public class Style extends SVGObj {
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;
+ }
}