aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2000-11-08 05:08:34 +0000
committerKeiron Liddle <keiron@apache.org>2000-11-08 05:08:34 +0000
commitd9a4798d5dd355f282f13ade19addbf19f7a954a (patch)
treeaf9d3d2d290f45eb56837b94ac799f86ac702bd9 /src/org/apache
parent35dae507c6e3064bbb05ecc2db183db08ce453b9 (diff)
downloadxmlgraphics-fop-d9a4798d5dd355f282f13ade19addbf19f7a954a.tar.gz
xmlgraphics-fop-d9a4798d5dd355f282f13ade19addbf19f7a954a.zip
creates pattern graphic
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193747 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache')
-rw-r--r--src/org/apache/fop/svg/Pattern.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/org/apache/fop/svg/Pattern.java b/src/org/apache/fop/svg/Pattern.java
index 73ae9ae4d..9d8da25ad 100644
--- a/src/org/apache/fop/svg/Pattern.java
+++ b/src/org/apache/fop/svg/Pattern.java
@@ -59,6 +59,8 @@ 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:Pattern pseudo flow object.
*
@@ -103,4 +105,27 @@ public class Pattern extends SVGObj {
super(parent, propertyList);
this.name = "svg:pattern";
}
+
+ public SVGElement createGraphic() {
+ SVGPatternElement pattern = new SVGPatternElementImpl();
+// pattern.setStyle(
+// ((SVGStyle) this.properties.get("style")).getStyle());
+// pattern.setTransform(
+// ((SVGTransform) this.properties.get("transform")).
+// getTransform());
+ pattern.setId(this.properties.get("id").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 instanceof SVGElementImpl)
+ ((SVGElementImpl)impl).setClassName(new SVGAnimatedStringImpl(((FObj)child).getProperty("class").getString()));
+ pattern.appendChild(impl);
+ }
+ }
+ }
+ return pattern;
+ }
}