You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2001/03/13 06:28:27 UTC

cvs commit: xml-fop/src/org/apache/fop/svg SVG.java SVGObj.java

keiron      01/03/12 21:28:27

  Modified:    lib      Tag: fop-0_17_0_batikSVG batik.jar
               src/codegen Tag: fop-0_17_0_batikSVG elements.dtd
                        elements.xsl svgelements.xml svgproperties.xml
               src/org/apache/fop/render/awt Tag: fop-0_17_0_batikSVG
                        AWTRenderer.java
               src/org/apache/fop/svg Tag: fop-0_17_0_batikSVG SVG.java
                        SVGObj.java
  Log:
  renders svg to the awt viewer using batik
  doesn't handle all svg due to lack of property handling
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +3683 -3590xml-fop/lib/Attic/batik.jar
  
  	<<Binary file>>
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +9 -3      xml-fop/src/codegen/Attic/elements.dtd
  
  Index: elements.dtd
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/codegen/Attic/elements.dtd,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- elements.dtd	2001/03/01 01:16:06	1.1.2.1
  +++ elements.dtd	2001/03/13 05:28:25	1.1.2.2
  @@ -1,14 +1,20 @@
  -<!-- $Id: elements.dtd,v 1.1.2.1 2001/03/01 01:16:06 keiron Exp $ -->
  +<!-- $Id: elements.dtd,v 1.1.2.2 2001/03/13 05:28:25 keiron Exp $ -->
   <!--
   DTD for svgelements.xml
   -->
   
   <!DOCTYPE elements [
  -<!ELEMENT elements (element+) >
  +<!ELEMENT elements (commonAttributes+, element+) >
   <!ATTLIST elements
       prefix CDATA #REQUIRED
       ns CDATA #REQUIRED>
   <!ELEMENT element (tagname, attributes) >
   <!ELEMENT tagname (#PCDATA) >
  -<!ELEMENT attributes (attribute+) >
  +<!ELEMENT attributes ((attribute | includeAttributes)+) >
  +<!ELEMENT commonAttributes ((attribute | includeAttributes)+) >
  +<!ATTLIST commonAttributes
  +    ref CDATA #REQUIRED>
   <!ELEMENT attribute (#PCDATA) >
  +<!ELEMENT includeAttributes (#PCDATA) >
  +<!ATTLIST includeAttributes
  +    ref CDATA #REQUIRED>
  
  
  
  1.1.2.2   +23 -10    xml-fop/src/codegen/Attic/elements.xsl
  
  Index: elements.xsl
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/codegen/Attic/elements.xsl,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- elements.xsl	2001/03/01 01:16:06	1.1.2.1
  +++ elements.xsl	2001/03/13 05:28:26	1.1.2.2
  @@ -33,6 +33,23 @@
     </xsl:choose>
   </xsl:template>
   
  +<xsl:template match="attributes"><xsl:apply-templates/></xsl:template>
  +
  +<xsl:template match="includeAttributes">
  +<xsl:variable name="attr-ref">
  +  <xsl:value-of select="@ref"/>
  +</xsl:variable>
  +<xsl:for-each select="/elements/commonAttributes">
  +  <xsl:choose>
  +    <xsl:when test="@ref = $attr-ref">
  +    <xsl:apply-templates/>
  +    </xsl:when>
  +  </xsl:choose>
  +</xsl:for-each>
  +</xsl:template>
  +
  +<xsl:template match="attribute">"<xsl:apply-templates/>"<xsl:if test="not(position()=last())">, </xsl:if></xsl:template>
  +
   <xsl:template match="elements">
       <xsl:apply-templates select="element"/>
   </xsl:template>
  @@ -77,17 +94,17 @@
   public class <xsl:value-of select="$classname"/> extends SVGObj {
   
       /**
  -     * inner class for making A objects.
  +     * inner class for making <xsl:apply-templates select="tagname"/> objects.
        */
       public static class Maker extends FObj.Maker {
   
           /**
  -         * make a A object.
  +         * make a <xsl:apply-templates select="tagname"/> object.
            *
            * @param parent the parent formatting object
            * @param propertyList the explicit properties of this object
            *
  -         * @return the A object
  +         * @return the <xsl:apply-templates select="tagname"/> object
            */
           public FObj make(FObj parent,
                            PropertyList propertyList) throws FOPException {
  @@ -98,14 +115,14 @@
       /**
        * returns the maker for this object.
        *
  -     * @return the maker for A objects
  +     * @return the maker for <xsl:apply-templates select="tagname"/> objects
        */
       public static FObj.Maker maker() {
           return new <xsl:value-of select="$classname"/>.Maker();
       }
   
       /**
  -     * constructs a A object (called by Maker).
  +     * constructs a <xsl:apply-templates select="tagname"/> object (called by Maker).
        *
        * @param parent the parent formatting object
        * @param propertyList the explicit properties of this object
  @@ -114,11 +131,7 @@
           super(parent, propertyList);
           this.name = "<xsl:value-of select="//@prefix"/>:<xsl:value-of select="$name"/>";
           tagName = "<xsl:value-of select="$name"/>";
  -        props = new String[] {
  -            <xsl:for-each select="attributes/attribute">
  -                "<xsl:apply-templates/>"<xsl:if test="not(position()=last())">, </xsl:if>
  -            </xsl:for-each>
  -        };
  +        props = new String[] {<xsl:apply-templates select="attributes"/>};
       }
   
   <xsl:if test="@addText">
  
  
  
  1.1.2.2   +153 -1    xml-fop/src/codegen/Attic/svgelements.xml
  
  Index: svgelements.xml
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/codegen/Attic/svgelements.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- svgelements.xml	2001/03/01 01:16:06	1.1.2.1
  +++ svgelements.xml	2001/03/13 05:28:26	1.1.2.2
  @@ -1,5 +1,114 @@
   <?xml version="1.0" ?>
  -<elements prefix="svg" ns="http:">
  +<elements prefix="svg" ns="http://www.w3.org/2000/svg">
  +    <commonAttributes ref="stdAttrs">
  +        <attribute>id</attribute>
  +        <attribute>class</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="langSpaceAttrs">
  +        <attribute>xml:lang</attribute>
  +        <attribute>xml:space</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="testAttrs">
  +        <attribute>requiredFeatures</attribute>
  +        <attribute>requiredExtensions</attribute>
  +        <attribute>systemLanguage</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-All">
  +        <includeAttributes ref="PresentationAttributes-Containers"/>
  +        <includeAttributes ref="PresentationAttributes-feFlood"/>
  +        <includeAttributes ref="PresentationAttributes-FillStroke"/>
  +        <includeAttributes ref="PresentationAttributes-FontSpecification"/>
  +        <includeAttributes ref="PresentationAttributes-Gradients"/>
  +        <includeAttributes ref="PresentationAttributes-Graphics"/>
  +        <includeAttributes ref="PresentationAttributes-Images"/>
  +        <includeAttributes ref="PresentationAttributes-LightingEffects"/>
  +        <includeAttributes ref="PresentationAttributes-Markers"/>
  +        <includeAttributes ref="PresentationAttributes-TextContentElements"/>
  +        <includeAttributes ref="PresentationAttributes-TextElements"/>
  +        <includeAttributes ref="PresentationAttributes-Viewports"/>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-Containers">
  +        <attribute>enable-background</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-feFlood">
  +        <attribute>flood-color</attribute>
  +        <attribute>flood-opacity</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-FillStroke">
  +        <attribute>fill</attribute>
  +        <attribute>fill-opacity</attribute>
  +        <attribute>fill-rule</attribute>
  +        <attribute>stroke</attribute>
  +        <attribute>stroke-dasharray</attribute>
  +        <attribute>stroke-dashoffset</attribute>
  +        <attribute>stroke-linecap</attribute>
  +        <attribute>stroke-linejoin</attribute>
  +        <attribute>stroke-miterlimit</attribute>
  +        <attribute>stroke-opacity</attribute>
  +        <attribute>stroke-width</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-FontSpecification">
  +        <attribute>font-family</attribute>
  +        <attribute>font-size</attribute>
  +        <attribute>font-size-adjust</attribute>
  +        <attribute>font-stretch</attribute>
  +        <attribute>font-style</attribute>
  +        <attribute>font-variant</attribute>
  +        <attribute>font-weight</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-Gradients">
  +        <attribute>stop-color</attribute>
  +        <attribute>stop-opacity</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-Graphics">
  +        <attribute>clip-path</attribute>
  +        <attribute>clip-rule</attribute>
  +        <attribute>color</attribute>
  +        <attribute>color-interpolation</attribute>
  +        <attribute>color-rendering</attribute>
  +        <attribute>cursor</attribute>
  +        <attribute>display</attribute>
  +        <attribute>filter</attribute>
  +        <attribute>image-rendering</attribute>
  +        <attribute>mask</attribute>
  +        <attribute>opacity</attribute>
  +        <attribute>pointer-events</attribute>
  +        <attribute>space-rendering</attribute>
  +        <attribute>text-rendering</attribute>
  +        <attribute>visibility</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-Images">
  +        <attribute>color-profile</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-LightingEffects">
  +        <attribute>lighting-color</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-Markers">
  +        <attribute>marker-start</attribute>
  +        <attribute>marker-mid</attribute>
  +        <attribute>marker-end</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-TextContentElements">
  +        <attribute>alignment-baseline</attribute>
  +        <attribute>baseline-shift</attribute>
  +        <attribute>direction</attribute>
  +        <attribute>glyph-orientation-horizontal</attribute>
  +        <attribute>glyph-orientation-vertical</attribute>
  +        <attribute>kerning</attribute>
  +        <attribute>letter-spacing</attribute>
  +        <attribute>text-decoration</attribute>
  +        <attribute>unicode-bidi</attribute>
  +        <attribute>word-spacing</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-TextElements">
  +        <attribute>writing-mode</attribute>
  +        <attribute>text-anchor</attribute>
  +        <attribute>dominant-baseline</attribute>
  +    </commonAttributes>
  +    <commonAttributes ref="PresentationAttributes-Viewports">
  +        <attribute>clip</attribute>
  +        <attribute>overflow</attribute>
  +    </commonAttributes>
       <element>
           <tagname>a</tagname>
           <attributes>
  @@ -9,6 +118,9 @@
       <element>
           <tagname>circle</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
  +            <includeAttributes ref="PresentationAttributes-FillStroke"/>
  +            <includeAttributes ref="PresentationAttributes-Graphics"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -20,31 +132,37 @@
       <element>
           <tagname>altGlyph</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>animate</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>animateColor</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>animateMotion</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>animateTransform</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>clipPath</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>clipPathUnits</attribute>
  @@ -53,11 +171,13 @@
       <element>
           <tagname>cursor</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>defs</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element addText="true">
  @@ -68,6 +188,7 @@
       <element>
           <tagname>ellipse</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -80,16 +201,19 @@
       <element>
           <tagname>filter</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>font</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>g</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -99,16 +223,19 @@
       <element>
           <tagname>glyph</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>hkern</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>image</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -123,6 +250,7 @@
       <element>
           <tagname>line</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -136,6 +264,7 @@
       <element>
           <tagname>linearGradient</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -153,11 +282,13 @@
       <element>
           <tagname>marker</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>mask</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
           </attributes>
  @@ -165,11 +296,13 @@
       <element>
           <tagname>missing-glyph</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>path</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -180,6 +313,7 @@
       <element>
           <tagname>pattern</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -195,6 +329,7 @@
       <element>
           <tagname>polygon</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -205,6 +340,7 @@
       <element>
           <tagname>polyline</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -215,6 +351,7 @@
       <element>
           <tagname>radialGradient</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -232,6 +369,9 @@
       <element>
           <tagname>rect</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
  +            <includeAttributes ref="PresentationAttributes-FillStroke"/>
  +            <includeAttributes ref="PresentationAttributes-Graphics"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -247,11 +387,13 @@
       <element>
           <tagname>set</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>stop</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>offset</attribute>
  @@ -260,11 +402,13 @@
       <element addText="true">
           <tagname>style</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>switch</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>requiredFeatures</attribute>
               <attribute>requiredExtensions</attribute>
  @@ -274,6 +418,7 @@
       <element>
           <tagname>symbol</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>viewBox</attribute>
  @@ -282,6 +427,7 @@
       <element>
           <tagname>tref</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>xlink:href</attribute>
  @@ -294,6 +440,7 @@
       <element addText="true">
           <tagname>tspan</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>x</attribute>
  @@ -305,6 +452,7 @@
       <element addText="true">
           <tagname>text</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -317,6 +465,7 @@
       <element addText="true">
           <tagname>textPath</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>xlink:href</attribute>
  @@ -325,11 +474,13 @@
       <element addText="true">
           <tagname>title</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
       <element>
           <tagname>use</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
               <attribute>id</attribute>
               <attribute>style</attribute>
               <attribute>transform</attribute>
  @@ -343,6 +494,7 @@
       <element>
           <tagname>vkern</tagname>
           <attributes>
  +            <includeAttributes ref="stdAttrs"/>
           </attributes>
       </element>
   </elements>
  
  
  
  1.3.2.2   +104 -1    xml-fop/src/codegen/svgproperties.xml
  
  Index: svgproperties.xml
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/codegen/svgproperties.xml,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- svgproperties.xml	2001/03/01 23:24:16	1.3.2.1
  +++ svgproperties.xml	2001/03/13 05:28:26	1.3.2.2
  @@ -90,7 +90,6 @@
       <name>offset</name>
       <use-generic ispropclass="true">SVGStringProperty</use-generic>
     </property>
  -
     <property>
       <name>style</name>
       <use-generic ispropclass="true">SVGStringProperty</use-generic>
  @@ -109,6 +108,110 @@
     </property>
     <property>
       <name>points</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>fill</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>fill-opacity</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>fill-rule</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>stroke</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>stroke-dasharray</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>stroke-dashoffset</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>stroke-linecap</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>stroke-linejoin</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>stroke-miterlimit</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>stroke-opacity</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>stroke-width</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>clip-path</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>clip-rule</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>color</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>color-interpolation</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>color-rendering</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>cursor</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>display</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>filter</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>image-rendering</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>opacity</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>mask</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>space-rendering</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>text-rendering</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>pointer-events</name>
  +    <use-generic ispropclass="true">SVGStringProperty</use-generic>
  +  </property>
  +  <property>
  +    <name>visibility</name>
       <use-generic ispropclass="true">SVGStringProperty</use-generic>
     </property>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.18.2.2  +190 -6    xml-fop/src/org/apache/fop/render/awt/AWTRenderer.java
  
  Index: AWTRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/awt/AWTRenderer.java,v
  retrieving revision 1.18.2.1
  retrieving revision 1.18.2.2
  diff -u -r1.18.2.1 -r1.18.2.2
  --- AWTRenderer.java	2001/03/01 02:20:39	1.18.2.1
  +++ AWTRenderer.java	2001/03/13 05:28:26	1.18.2.2
  @@ -21,6 +21,13 @@
   
   import org.w3c.dom.svg.*;
   
  +import org.apache.batik.bridge.*;
  +import org.apache.batik.swing.svg.*;
  +import org.apache.batik.swing.gvt.*;
  +import org.apache.batik.gvt.*;
  +import org.apache.batik.gvt.renderer.*;
  +import org.apache.batik.gvt.filter.*;
  +
   import java.awt.*;
   import java.awt.Image;
   import java.awt.image.*;
  @@ -627,8 +634,13 @@
   
           Enumeration e = area.getChildren().elements();
           while (e.hasMoreElements()) {
  -            org.apache.fop.layout.Box b =
  -              (org.apache.fop.layout.Box) e.nextElement();
  +            org.apache.fop.layout.Box b = (org.apache.fop.layout.Box) e.nextElement();
  +            if(b instanceof InlineArea) {
  +                InlineArea ia = (InlineArea)b;
  +                this.currentYPosition = ry - ia.getYOffset();
  +            } else {
  +                this.currentYPosition = ry - area.getPlacementOffset();
  +            }
               b.render(this);
           }
   
  @@ -660,18 +672,99 @@
   	this.currentXPosition += area.getContentWidth();
     }
   
  -
       public void renderSVGArea(SVGArea area) {
   
  -        int x = this.currentAreaContainerXPosition;
  +        int x = this.currentXPosition;
           int y = this.currentYPosition;
           int w = area.getContentWidth();
           int h = area.getHeight();
  +
  +//        this.currentYPosition -= h;
  +
  +        SVGDocument doc = area.getSVGDocument();
  +
  +        UserAgent userAgent = new MUserAgent(new AffineTransform());
  +
  +        GVTBuilder builder = new GVTBuilder();
  +        GraphicsNodeRenderContext rc = getRenderContext();
  +        BridgeContext ctx = new BridgeContext(userAgent, rc);
  +        GraphicsNode root;
  +        try {
  +            root = builder.build(ctx, doc);
  +            //rc.setTransform(new AffineTransform(1, 0, x, 0, 1, y));
  +            graphics.translate(x / 1000f, pageHeight - y / 1000f);
  +            root.paint(graphics, rc);
  +            graphics.translate(-x / 1000f, y / 1000f - pageHeight);
  +        } catch(Exception e) {
  +            e.printStackTrace();
  +        }
  +        this.currentXPosition += area.getContentWidth();
   
  -        this.currentYPosition -= h;
  +/*        final JSVGComponent svgComponent = new JSVGComponent(userAgent, true, true);
  +//        JFrame frame = new JFrame();
  +//        frame.setSize(300, 300);
  +//        frame.getContentPane().add(svgComponent);
  +//        frame.setVisible(true);
  +        svgComponent.setSVGDocument(doc);
  +
  +        svgComponent.addGVTTreeRendererListener(new GVTTreeRendererListener() {
  +            public void gvtRenderingPrepare(GVTTreeRendererEvent e)
  +            {
  +                System.out.println("rendering prepare:" + e);
  +            }
   
  +            public void gvtRenderingStarted(GVTTreeRendererEvent e)
  +            {
  +                System.out.println("rendering started:" + e);
  +            }
  +
  +            public void gvtRenderingCancelled(GVTTreeRendererEvent e)
  +            {
  +            }
  +
  +            public void gvtRenderingFailed(GVTTreeRendererEvent e)
  +            {
  +            }
  +
  +            public void gvtRenderingCompleted(GVTTreeRendererEvent e)
  +            {
  +                System.out.println("rendering complete:" + e);
  +                Object src = e.getSource();
  +                Image im = e.getImage();
  +                svgComponent.paint(graphics);
  +            }
  +        });*/
       }
   
  +    public GraphicsNodeRenderContext getRenderContext() {
  +        GraphicsNodeRenderContext nodeRenderContext = null;
  +        if (nodeRenderContext == null) {
  +            RenderingHints hints = new RenderingHints(null);
  +            hints.put(RenderingHints.KEY_ANTIALIASING,
  +                  RenderingHints.VALUE_ANTIALIAS_ON);
  +
  +            hints.put(RenderingHints.KEY_INTERPOLATION,
  +                  RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  +
  +            FontRenderContext fontRenderContext =
  +                new FontRenderContext(new AffineTransform(), true, true);
  +
  +            TextPainter textPainter = new StrokingTextPainter();
  +
  +            GraphicsNodeRableFactory gnrFactory =
  +                new ConcreteGraphicsNodeRableFactory();
  +
  +            nodeRenderContext =
  +                new GraphicsNodeRenderContext(new AffineTransform(),
  +                                          null,
  +                                          hints,
  +                                          fontRenderContext,
  +                                          textPainter,
  +                                          gnrFactory);
  +            }
  +
  +        return nodeRenderContext;
  +    }
   
   
       public void setProducer(String producer) {
  @@ -776,7 +869,98 @@
           area.getObject().render(this);
       }
   
  -}
  +    protected class MUserAgent implements UserAgent {
  +        AffineTransform currentTransform = null;
  +        /**
  +         * Creates a new SVGUserAgent.
  +         */
  +        protected MUserAgent(AffineTransform at) {
  +            currentTransform = at;
  +        }
  +
  +        /**
  +         * Displays an error message.
  +         */
  +        public void displayError(String message) {
  +            System.err.println(message);
  +        }
  +    
  +        /**
  +         * Displays an error resulting from the specified Exception.
  +         */
  +        public void displayError(Exception ex) {
  +            ex.printStackTrace(System.err);
  +        }
  +
  +        /**
  +         * Displays a message in the User Agent interface.
  +         * The given message is typically displayed in a status bar.
  +         */
  +        public void displayMessage(String message) {
  +            System.out.println(message);
  +        }
  +
  +        /**
  +         * Returns a customized the pixel to mm factor.
  +         */
  +        public float getPixelToMM() {
  +            return 0.264583333333333333333f; // 72 dpi
  +        }
  +
  +        /**
  +         * Returns the language settings.
  +         */
  +        public String getLanguages() {
  +            return "en";//userLanguages;
  +        }
  +
  +        /**
  +         * Returns the user stylesheet uri.
  +         * @return null if no user style sheet was specified.
  +         */
  +        public String getUserStyleSheetURI() {
  +            return null;//userStyleSheetURI;
  +        }
  +
  +        /**
  +         * Returns the class name of the XML parser.
  +         */
  +        public String getXMLParserClassName() {
  +	String parserClassName =
  +	    System.getProperty("org.xml.sax.parser");
  +	if (parserClassName == null) {
  +	    parserClassName = "org.apache.xerces.parsers.SAXParser";
  +	}
  +            return parserClassName;//application.getXMLParserClassName();
  +        }
   
  +        /**
  +         * Opens a link in a new component.
  +         * @param doc The current document.
  +         * @param uri The document URI.
  +         */
  +        public void openLink(SVGAElement elt)
  +        {
  +            //application.openLink(uri);
  +        }
   
  +        public Point getClientAreaLocationOnScreen()
  +        {
  +            return new Point(0, 0);
  +        }
  +
  +        public void setSVGCursor(java.awt.Cursor cursor)
  +        {
  +        }
  +
  +        public AffineTransform getTransform()
  +        {
  +            return currentTransform;
  +        }
   
  +        public Dimension2D getViewportSize()
  +        {
  +            return new Dimension(100, 100);
  +        }
  +    }
  +}
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.18.2.2  +3 -3      xml-fop/src/org/apache/fop/svg/SVG.java
  
  Index: SVG.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/SVG.java,v
  retrieving revision 1.18.2.1
  retrieving revision 1.18.2.2
  diff -u -r1.18.2.1 -r1.18.2.2
  --- SVG.java	2001/03/01 02:12:16	1.18.2.1
  +++ SVG.java	2001/03/13 05:28:27	1.18.2.2
  @@ -1,4 +1,4 @@
  -/*-- $Id: SVG.java,v 1.18.2.1 2001/03/01 02:12:16 keiron Exp $ --
  +/*-- $Id: SVG.java,v 1.18.2.2 2001/03/13 05:28:27 keiron Exp $ --
   
    ============================================================================
   									 The Apache Software License, Version 1.1
  @@ -236,7 +236,7 @@
   
                   DefaultSVGContext dc = new DefaultSVGContext() {
                           public float getPixelToMM() {
  -                            return 12;
  +                            return 0.264583333333333333333f; // 72 dpi
                           }
                           public float getViewportWidth() {
                               return 100;
  @@ -247,7 +247,7 @@
                       };
                   doc.setSVGContext(dc);
   
  -                System.out.println("tag:" + tagName);
  +                //System.out.println("tag:" + tagName);
                   Element topLevel = doc.createElementNS("http://www.w3.org/2000/svg", tagName);
                   for(int count = 0; count < props.length; count++) {
                       String rf = this.properties.get(props[count]).getString();
  
  
  
  1.1.4.2   +5 -3      xml-fop/src/org/apache/fop/svg/SVGObj.java
  
  Index: SVGObj.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/SVGObj.java,v
  retrieving revision 1.1.4.1
  retrieving revision 1.1.4.2
  diff -u -r1.1.4.1 -r1.1.4.2
  --- SVGObj.java	2001/03/01 02:12:19	1.1.4.1
  +++ SVGObj.java	2001/03/13 05:28:27	1.1.4.2
  @@ -1,4 +1,4 @@
  -/*-- $Id: SVGObj.java,v 1.1.4.1 2001/03/01 02:12:19 keiron Exp $ -- 
  +/*-- $Id: SVGObj.java,v 1.1.4.2 2001/03/13 05:28:27 keiron Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -84,8 +84,10 @@
           Element element = doc.createElementNS("http://www.w3.org/2000/svg", tagName);
   //        Element element = doc.createElement(tagName);
           for(int count = 0; count < props.length; count++) {
  -            String rf = this.properties.get(props[count]).getString();
  -            element.setAttribute(props[count], rf);
  +            if(this.properties.get(props[count]) != null) {
  +                String rf = this.properties.get(props[count]).getString();
  +                element.setAttribute(props[count], rf);
  +            }
           }
           parent.appendChild(element);
           int numChildren = this.children.size();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org