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 je...@apache.org on 2009/02/22 13:40:55 UTC

svn commit: r746664 [2/8] - in /xmlgraphics/fop/trunk: ./ examples/embedding/java/embedding/atxml/ examples/embedding/java/embedding/intermediate/ examples/embedding/xml/xslt/ examples/plan/src/org/apache/fop/plan/ lib/ src/documentation/content/xdocs/...

Modified: xmlgraphics/fop/trunk/lib/xmlgraphics-commons-1.4svn.jar
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/lib/xmlgraphics-commons-1.4svn.jar?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
Binary files - no diff available.

Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/intermediate.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/intermediate.xml?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/intermediate.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/intermediate.xml Sun Feb 22 12:40:44 2009
@@ -24,16 +24,25 @@
   </header>
   <body>
     <note>
-      Please note that the intermediate format is an <strong>advanced feature</strong> and can be ignored by most
-      users of Apache FOP.
+      Please note that the intermediate formats described here are
+      <strong>advanced features</strong> and can be ignored by most users of Apache FOP.
     </note>
     <section id="introduction">
       <title>Introduction</title>
       <p>
-        The intermediate format (IF) is a proprietary XML format that represents the area tree 
-        generated by the layout engine. The area tree is conceptually defined in the 
+        Apache FOP now provides two different so-called intermediate formats. The first one
+        (let's call it the area tree XML format) is basically a 1:1 XML representation of FOP's
+        area tree as generated by the layout engine. The area tree is conceptually defined in the 
         <a href="http://www.w3.org/TR/2001/REC-xsl-20011015/slice1.html#section-N742-Formatting">XSL-FO specification in chapter 1.1.2</a>.
-        The IF can be generated through the area tree XML Renderer (the XMLRenderer).
+        Even though the area tree is mentioned in the XSL-FO specification, this part is not
+        standardized. Therefore, the area tree XML format is a FOP-proprietary XML file format.
+        The area tree XML can be generated through the area tree XML Renderer (the XMLRenderer).
+      </p>
+      <p>
+        The second intermediate format (which we shall name exactly like this: the intermediate 
+        format)
+        is a recent addition which tries to meet a slightly different set of goals. It is highly
+        optimized for speed.
       </p>
       <p>
         The intermediate format can be used to generate intermediate documents that are modified 
@@ -43,31 +52,74 @@
         to a single output file.
       </p>
     </section>
+    <section id="which-if">
+      <title>Which Intermediate Format to choose?</title>
+      <p>
+        Both formats have their use cases, so the choice you will make will depend on your 
+        particular situation. Here is a list of strengths and use cases for both formats:
+      </p>
+      <section id="strengths-at">
+        <title>Area Tree XML (AT XML)</title>
+        <ul>
+          <li>1:1 representation of FOP's area tree in XML.</li>
+          <li>Contains more structure information than the new intermediate format.</li>
+          <li>Used in FOP's layout engine test suite for regression testing.</li>
+        </ul>
+      </section>
+      <section id="strengths-if">
+        <title>Intermediate Format (IF)</title>
+        <ul>
+          <li>Highly optimized for speed.</li>
+          <li>Smaller XML files.</li>
+          <li>Easier to post-process.</li>
+          <li>XML Schema is available.</li>
+          <li>
+            Recommended for use cases where documents are formatted concurrently and later
+            concatenated to a single print job.
+          </li>
+        </ul>
+      </section>
+      <p>
+        More technical information about the two formats can be found on the
+        <a href="http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml/NewDesign">FOP Wiki</a>.
+      </p>
+    </section>
+    <section id="architecture">
+      <title>Architectural Overview</title>
+      <figure src="images/if-architecture-overview.png"
+        alt="Diagram with an architectural overview over the intermediate formats"/>
+    </section>
     <section id="usage">
-      <title>Usage of the Intermediate Format</title>
+      <title>Usage of the Area Tree XML format (AT XML)</title>
+      <p>
+        As already mentioned, the area tree XML format is generated by using the
+        <strong>XMLRenderer</strong> (MIME type: <strong>application/X-fop-areatree</strong>).
+        So, you basically set the right MIME type for the output format and process your FO files
+        as if you would create a PDF file.
+      </p>
       <p>
-        As already mentioned, the IF is generated by using the <strong>XMLRenderer</strong> (MIME type: 
-        <strong>application/X-fop-areatree</strong>). So, you basically set the right MIME type for
-        the output format and process your FO files as if you would create a PDF file. However, there
-        is an important detail to consider: The various Renderers don't all use the same font sources.
-        To be able to create the right area tree for the ultimate output file, you need to create
-        the IF file using the right font setup. This is achieved by telling the XMLRenderer to mimic
-        another renderer. This is done by calling the XMLRenderer's mimicRenderer() method with an
-        instance of the ultimate target renderer as the single parameter. This has a consequence: An
-        IF file rendered with the Java2DRenderer may not look as expected when it was actually generated
-        for the PDF renderer. For renderers that use the same font setup, this restriction does not
-        apply (PDF and PS, for example). Generating the intermediate format file is the first step.
-      </p>
-      <p>
-        The second step is to reparse the IF file using the <strong>AreaTreeParser</strong> which is 
-        found in the org.apache.fop.area package. The pages retrieved from the IF file are added to an
-        AreaTreeModel instance from where they are normally rendered using one of the available Renderer
-        implementations. You can find examples for the IF processing in the 
-        <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"><code>examples/embedding</code></a>
-        directory in the FOP distribution
+        However, there is an important detail to consider: The
+        various Renderers don't all use the same font sources. To be able to create the right
+        area tree for the ultimate output format, you need to create the area tree XML file using
+        the right font setup. This is achieved by telling the XMLRenderer to mimic another
+        renderer. This is done by calling the XMLRenderer's mimicRenderer() method with an
+        instance of the ultimate target renderer as the single parameter. This has a consequence:
+        An area tree XML file rendered with the Java2DRenderer may not look as expected when it
+        was actually generated for the PDF renderer. For renderers that use the same font setup,
+        this restriction does not apply (PDF and PS, for example). Generating the area tree XML
+        format file is the first step.
       </p>
       <p>
-        The basic pattern to parse the IF format looks like this:
+        The second step is to reparse the file using the <strong>AreaTreeParser</strong> which is
+        found in the org.apache.fop.area package. The pages retrieved from the area tree XML file
+        are added to an AreaTreeModel instance from where they are normally rendered using one of
+        the available Renderer implementations. You can find examples for the area tree XML
+        processing in the 
+        <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"><code>examples/embedding</code></a>
+        directory in the FOP distribution.
+      </p>
+      <p>
+        The basic pattern to parse the area tree XML format looks like this:
       </p>
       <source><![CDATA[
 FopFactory fopFactory = FopFactory.newInstance();      
@@ -84,7 +136,7 @@
     AreaTreeModel treeModel = new RenderPagesModel(userAgent, 
             MimeConstants.MIME_PDF, fontInfo, out);
             
-    //Parse the IF file into the area tree
+    //Parse the area tree file into the area tree
     AreaTreeParser parser = new AreaTreeParser();
     Source src = new StreamSource(myIFFile);
     parser.parse(src, treeModel, userAgent);
@@ -95,7 +147,7 @@
     out.close();
 }]]></source>
       <p>
-        This example simply reads an IF file and renders it to a PDF file. Please note, that in normal
+        This example simply reads an area tree file and renders it to a PDF file. Please note, that in normal
         FOP operation you're shielded from having to instantiate the FontInfo object yourself. This
         is normally a task of the AreaTreeHandler which is not present in this scenario. The same
         applies to the AreaTreeModel instance, in this case an instance of a subclass called 
@@ -105,7 +157,7 @@
         is now finished.
       </p>
       <p>
-        The intermediate format can also be used from the <a href="running.html#standalone-start">command-line</a>
+        The area tree XML format can also be used from the <a href="running.html#standalone-start">command-line</a>
         by using the "-atin" parameter for specifying the area tree XML as input file. You can also 
         specify a "mimic renderer" by inserting a MIME type between "-at" and the output file.
       </p>
@@ -113,8 +165,8 @@
         <title>Concatenating Documents</title>
         <p>
           This initial example is obviously not very useful. It would be faster to create the PDF file 
-          directly. As the <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java">ExampleConcat.java</a>
-          example shows you can easily parse multiple IF files in a row and add the parsed pages to the
+          directly. As the <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/atxml/ExampleConcat.java">ExampleConcat.java</a>
+          example shows you can easily parse multiple area tree files in a row and add the parsed pages to the
           same AreaTreeModel instance which essentially concatenates all the input document to one single
           output document.
         </p>
@@ -122,18 +174,22 @@
       <section id="modifying">
         <title>Modifying Documents</title>
         <p>
-          One of the most important use cases for the intermediate format is obviously modifying the area
+          One of the most important use cases for this format is obviously modifying the area
           tree XML before finally rendering it to the target format. You can easily use XSLT to process
-          the IF file according to your needs. Please note, that we will currently not formally describe
-          the intermediate format. You need to have a good understanding its structure so you don't
+          the AT XML file according to your needs. Please note, that we will currently not formally describe
+          the area tree XML format. You need to have a good understanding its structure so you don't
           create any non-parseable files. We may add an XML Schema and more detailed documentation at a
           later time. You're invited to help us with that.
         </p>
+        <note>
+          The area tree XML format is sensitive to changes in whitespace. If you're not careful,
+          the modified file may not render correctly.
+        </note>
       </section>
       <section id="advanced">
         <title>Advanced Use</title>
         <p>
-          The generation of the intermediate format as well as it parsing process has been designed to allow
+          The generation of the area tree format as well as it parsing process has been designed to allow
           for maximum flexibility and optimization. Please note that you can call <code>setTransformerHandler()</code> on
           XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would like to
           do custom serialization (to a W3C DOM, for example) and/or to directly modify the area tree using 
@@ -142,5 +198,134 @@
         </p>
       </section>
     </section>
+    <section id="usage-if">
+      <title>Usage of the Intermediate Format (IF)</title>
+      <p>
+        The Intermediate Format (IF) is generated by the <strong>IFSerializer</strong>
+        (MIME type: <strong>application/X-fop-intermediate-format</strong>).
+        So, you basically set the right MIME type for the output format and process your FO files
+        as if you would create a PDF file.
+      </p>
+      <p>
+        The IFSerializer is an implementation of the <strong>IFDocumentHandler</strong> and
+        <strong>IFPainter</strong> interfaces. The <strong>IFRenderer</strong> class is responsible
+        for converting FOP's area tree into calls against these two interfaces.
+      </p>
+      <ul>
+        <li>
+          IFDocumentHandler: This interface is used on the document-level and defines the
+          overall structure of the Intermediate Format.
+        </li>
+        <li>
+          IFPainter: This interface is used to generate graphical page content like text, images
+          and borders.
+        </li>
+      </ul>
+      <p>
+        As with the AT XML, there is an important detail to consider: The various output
+        implementations don't all use the same font sources. To be able
+        to create the right IF for the ultimate output file, you need to create the IF file using
+        the right font setup. This is achieved by telling the IFRenderer (responsible for
+        converting the area tree into calls to the IFDocumentHandler and IFPainter interfaces) 
+        to mimic another renderer. This is done by calling the IFSerializer's
+        mimicDocumentHandler() method with an instance of the ultimate target document handler
+        as the single parameter. This has a consequence: An IF file rendered with the
+        Java2DDocumentHandler may not look as expected when it was actually generated for the PDF
+        implementation. For implementations that use the same font setup,
+        this restriction does not apply (PDF and PS, for example). Generating the Intermediate
+        Format file is the first step.
+      </p>
+      <p>
+        The second step is to reparse the file using the <strong>IFParser</strong> which is
+        found in the org.apache.fop.render.intermediate package. The IFParser simply takes an
+        IFDocumentHandler instance against which it generates the appropriate calls. The IFParser
+        is implemented as a SAX ContentHandler so you're free to choose the method for
+        post-processing the IF file(s). You can use XSLT or write SAX- or DOM-based code to
+        manipulate the contents. You can find examples for the Intermediate Format
+        processing in the 
+        <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"><code>examples/embedding</code></a>
+        directory in the FOP distribution.
+      </p>
+      <p>
+        The basic pattern to parse the intermediate format looks like this:
+      </p>
+      <source><![CDATA[
+FopFactory fopFactory = FopFactory.newInstance();
+      
+// Setup output
+OutputStream out = new java.io.FileOutputStream(pdffile);
+out = new java.io.BufferedOutputStream(out);
+try {
+    //Setup user agent
+    FOUserAgent userAgent = fopFactory.newFOUserAgent();
+
+    //Create IFDocumentHandler instance
+    IFDocumentHandler targetHandler;
+    String mime = MimeConstants.MIME_PDF;
+    targetHandler = fopFactory.getRendererFactory().createDocumentHandler(
+            userAgent, mime);
+
+    //Setup fonts
+    IFUtil.setupFonts(targetHandler);
+    
+    //Tell the target handler where to write the PDF to
+    targetHandler.setResult(new StreamResult(pdffile));
+
+    //Parse the IF file
+    IFParser parser = new IFParser();
+    Source src = new StreamSource(myIFFile);
+    parser.parse(src, targetHandler, userAgent);
+            
+} finally {
+    out.close();
+}]]></source>
+      <p>
+        This example simply reads an intermediate file and renders it to a PDF file. Here
+        IFParser.parse() is used, but you can also just get a SAX ContentHandler by using the
+        IFParser.getContentHandler() method.
+      </p>
+      <section id="concat-if">
+        <title>Concatenating Documents</title>
+        <p>
+          This initial example is obviously not very useful. It would be faster to create the PDF file 
+          directly (without the intermediate step). As the
+          <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java">ExampleConcat.java</a>
+          example shows you can easily parse multiple intermediate files in a row and use the
+          IFConcatenator class to concatenate page sequences from multiple source files to a single
+          output file. This particular example does the concatenation on the level of the
+          IFDocumentHandler interface. You could also do this in XSLT or using SAX on the XML level.
+          Whatever suits your process best.
+        </p>
+      </section>
+      <section id="modifying-if">
+        <title>Modifying Documents</title>
+        <p>
+          One of the most important use cases for this format is obviously modifying the
+          intermediate format before finally rendering it to the target format. You can easily use
+          XSLT to process the IF file according to your needs.
+        </p>
+        <p>
+          There is an XML Schema (located under
+          <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/">src/documentation/intermediate-format-ng</a>)
+          that helps you verify that your modified content is correct.
+        </p>
+        <p>
+          For certain output formats there's a caveat: Formats like AFP and PCL do not support
+          arbitrary transformations on the IF's "viewport" and "g" elements. Possible are
+          only rotations in 90 degree steps and translations.
+        </p>
+      </section>
+      <section id="advanced-if">
+        <title>Advanced Use</title>
+        <p>
+          The generation of the intermediate format as well as it parsing process has been
+          designed to allow for maximum flexibility and optimization. So rather than just passing
+          in a StreamResult to IFSerializer's setResult() method, you can also use a SAXResult
+          or a DOMResult. And as you've already seen , the IFParser on the other side allows you
+          to retrieve a ContentHandler instance where you can manually send SAX events to
+          start the parsing process (see <code>getContentHandler()</code>).
+        </p>
+      </section>
+    </section>
   </body>
 </document>

Modified: xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/example1.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/example1.xml?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/example1.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/example1.xml Sun Feb 22 12:40:44 2009
@@ -19,7 +19,8 @@
 <document xmlns="http://xmlgraphics.apache.org/fop/intermediate"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://xmlgraphics.apache.org/fop/intermediate fop-intermediate-format-ng.xsd"
-  xmlns:xlink="http://www.w3.org/1999/xlink">
+  xmlns:xlink="http://www.w3.org/1999/xlink"
+  xmlns:nav="http://xmlgraphics.apache.org/fop/intermediate/document-navigation">
   <header>
     <x:xmpmeta xmlns:x="adobe:ns:meta/">
       <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
@@ -44,7 +45,7 @@
   </header>
   
   <page-sequence id="ps1">
-    <page index="1" name="1">
+    <page index="0" name="1" width="595275" height="841889">
       <page-header>
         <ps:ps-setup-code xmlns:ps="apache:fop:extensions:postscript">%FOPTestPSSetupCode: General
           setup code here!</ps:ps-setup-code>
@@ -52,20 +53,21 @@
       <content>
         <!-- Note: this is not actual content that is supposed to make any sense.
              It is merely to give you an idea what the content can look like. -->
-        <box transform="translate(5000, 6000)" width="18000" height="10000">
+        <viewport transform="translate(5000, 6000)" width="18000" height="10000">
           <font family="Helvetica" style="normal" weight="400" variant="normal" size="12000"
             color="black"/>
-          <text x="1233 1241 1247 1253 1264" y="803">Hello</text>
-          <draw-rect x="1233" y="1200" width="20000" height="20000" fill="yellow" stroke="none"/>
-          <box transform="translate(1233, 1200)" width="20000" height="20000" clip="true">
+          <text x="1233" y="803">Hello</text>
+          <rect x="1233" y="1200" width="20000" height="20000" fill="yellow"/>
+          <viewport transform="translate(1233, 1200)" width="20000" height="20000" clip-rect="0 0 20000 20000">
             <image xlink:href="myimage.svg" x="0" y="0" width="20000" height="20000"/>
-          </box>
-        </box>
+          </viewport>
+        </viewport>
       </content>
       <page-trailer>
-        <target x="1233" y="803" name="toc"/>
-        <target x="1233" y="1200" name="chapter1"/>
+        <nav:goto-xy id="toc" page-index="0" x="1233" y="803"/>
+        <nav:goto-xy id="chapter1" page-index="0" x="1233" y="1200"/>
       </page-trailer>
     </page>
   </page-sequence>
+  <trailer/>
 </document>

Modified: xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-content.xsd
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-content.xsd?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-content.xsd (original)
+++ xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-content.xsd Sun Feb 22 12:40:44 2009
@@ -20,15 +20,26 @@
   targetNamespace="http://xmlgraphics.apache.org/fop/intermediate"
   xmlns:mf="http://xmlgraphics.apache.org/fop/intermediate">
   <xs:include schemaLocation="fop-intermediate-format-ng-datatypes.xsd"/>
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace"
+    schemaLocation="http://www.w3.org/2001/xml.xsd"/>
   <xs:complexType name="contentType">
     <xs:choice maxOccurs="unbounded" minOccurs="0">
-      <xs:element name="box">
+      <xs:element name="viewport">
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="mf:contentType">
               <xs:attribute name="transform" type="xs:string"/>
               <xs:attributeGroup ref="mf:sizeAtts"/>
-              <xs:attribute name="clip" type="xs:boolean" default="false"/>
+              <xs:attribute name="clip-rect" type="mf:rectangleType"/>
+            </xs:extension>
+          </xs:complexContent>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="g">
+        <xs:complexType>
+          <xs:complexContent>
+            <xs:extension base="mf:contentType">
+              <xs:attribute name="transform" type="xs:string"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
@@ -40,7 +51,7 @@
           <xs:attribute name="variant" type="mf:fontVariantType"/>
           <xs:attribute name="weight" type="mf:fontWeightType"/>
           <xs:attribute name="stretch" type="mf:fontStretchType"/>
-          <xs:attribute name="size" type="xs:positiveInteger"/>
+          <xs:attribute name="size" type="mf:lengthType"/>
           <xs:attribute name="color" type="mf:colorType"/>
         </xs:complexType>
       </xs:element>
@@ -48,50 +59,49 @@
         <xs:complexType>
           <xs:simpleContent>
             <xs:extension base="xs:string">
-              <xs:attribute name="x" use="required">
-                <xs:simpleType>
-                  <xs:list itemType="xs:integer"/>
-                </xs:simpleType>
-              </xs:attribute>
-              <xs:attribute name="y" use="required">
+              <xs:attribute name="x" use="required" type="mf:lengthType"/>
+              <xs:attribute name="y" use="required" type="mf:lengthType"/>
+              <xs:attribute name="letter-spacing" type="mf:lengthType"/>
+              <xs:attribute name="word-spacing" type="mf:lengthType"/>
+              <xs:attribute name="dx">
                 <xs:simpleType>
-                  <xs:list itemType="xs:integer"/>
+                  <xs:list itemType="mf:lengthType"/>
                 </xs:simpleType>
               </xs:attribute>
+              <xs:attribute ref="xml:space"/>
             </xs:extension>
           </xs:simpleContent>
         </xs:complexType>
       </xs:element>
-      <xs:element name="clip-path">
-        <xs:complexType>
-          <xs:attribute name="d" type="mf:pathDataType" use="required"/>
-        </xs:complexType>  
-      </xs:element>
-      <xs:element name="draw-path">
+      <xs:element name="clip-rect">
         <xs:complexType>
-          <xs:attribute name="d" type="mf:pathDataType" use="required"/>
-          <xs:attributeGroup ref="mf:fillStrokeAtts"/>
+          <xs:attributeGroup ref="mf:rectAtts"/>
         </xs:complexType>
       </xs:element>
-      <xs:element name="clip-rect">
+      <xs:element name="rect">
         <xs:complexType>
           <xs:attributeGroup ref="mf:rectAtts"/>
+          <xs:attributeGroup ref="mf:fillAtts"/>
         </xs:complexType>
       </xs:element>
-      <xs:element name="draw-rect">
+      <xs:element name="line">
         <xs:complexType>
-          <xs:attributeGroup ref="mf:rectAtts"/>
-          <xs:attributeGroup ref="mf:fillStrokeAtts"/>
+          <xs:attribute name="x1" use="required" type="mf:lengthType"/>
+          <xs:attribute name="y1" use="required" type="mf:lengthType"/>
+          <xs:attribute name="x2" use="required" type="mf:lengthType"/>
+          <xs:attribute name="y2" use="required" type="mf:lengthType"/>
+          <xs:attribute name="color" use="required" type="mf:colorType"/>
+          <xs:attribute name="stroke-width" use="required" type="mf:lengthType"/>
+          <xs:attribute name="style" use="required" type="mf:ruleStyle"/>
         </xs:complexType>
       </xs:element>
-      <xs:element name="draw-border-line">
+      <xs:element name="border-rect">
         <xs:complexType>
-          <xs:attribute name="x1" type="xs:integer" use="required"/>
-          <xs:attribute name="y1" type="xs:integer" use="required"/>
-          <xs:attribute name="x2" type="xs:integer" use="required"/>
-          <xs:attribute name="y2" type="xs:integer" use="required"/>
-          <xs:attribute name="width" type="xs:integer" use="required"/>
-          <xs:attribute name="style" type="mf:borderStyle" default="solid"/>
+          <xs:attributeGroup ref="mf:rectAtts"/>
+          <xs:attribute name="start" type="mf:borderDef"/>
+          <xs:attribute name="end" type="mf:borderDef"/>
+          <xs:attribute name="before" type="mf:borderDef"/>
+          <xs:attribute name="after" type="mf:borderDef"/>
         </xs:complexType>
       </xs:element>
       <xs:element name="image">
@@ -100,7 +110,7 @@
             <xs:extension base="xs:anyType">
               <!-- Either use element content with any namespace or xlink:href -->
               <xs:attributeGroup ref="mf:rectAtts"/>
-              <xs:anyAttribute namespace="http://www.w3.org/1999/xlink" processContents="skip"/>
+              <xs:attributeGroup ref="mf:foreignAtts"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
@@ -108,16 +118,25 @@
     </xs:choice>
   </xs:complexType>
   <xs:attributeGroup name="sizeAtts">
-    <xs:attribute name="width" type="xs:positiveInteger" use="required"/>
-    <xs:attribute name="height" type="xs:positiveInteger" use="required"/>
+    <xs:attribute name="width" type="mf:lengthType" use="required"/>
+    <xs:attribute name="height" type="mf:lengthType" use="required"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="posAtts">
+    <xs:attribute name="x" type="mf:lengthType" default="0"/>
+    <xs:attribute name="y" type="mf:lengthType" default="0"/>
   </xs:attributeGroup>
   <xs:attributeGroup name="rectAtts">
-    <xs:attribute name="x" type="xs:integer" default="0"/>
-    <xs:attribute name="y" type="xs:integer" default="0"/>
+    <xs:attributeGroup ref="mf:posAtts"/>
     <xs:attributeGroup ref="mf:sizeAtts"/>
   </xs:attributeGroup>
-  <xs:attributeGroup name="fillStrokeAtts">
+  <xs:attributeGroup name="fillAtts">
+    <xs:attribute name="fill" type="xs:string" default="none"/>
+  </xs:attributeGroup>
+  <!--xs:attributeGroup name="fillStrokeAtts">
     <xs:attribute name="fill" type="xs:string" default="none"/>
     <xs:attribute name="stroke" type="xs:string" default="none"/>
+  </xs:attributeGroup-->
+  <xs:attributeGroup name="foreignAtts">
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
   </xs:attributeGroup>
 </xs:schema>

Modified: xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-datatypes.xsd
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-datatypes.xsd?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-datatypes.xsd (original)
+++ xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-datatypes.xsd Sun Feb 22 12:40:44 2009
@@ -22,8 +22,8 @@
   <xs:simpleType name="colorType">
     <xs:restriction base="xs:string"/>
   </xs:simpleType>
-  <xs:simpleType name="pathDataType">
-    <xs:restriction base="xs:string"/>
+  <xs:simpleType name="lengthType">
+    <xs:restriction base="xs:int"/>
   </xs:simpleType>
   <xs:simpleType name="fontStyleType">
     <xs:restriction base="xs:string">
@@ -77,4 +77,30 @@
       <xs:enumeration value="outset"/>
     </xs:restriction>
   </xs:simpleType>
+  <xs:simpleType name="ruleStyle">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="solid"/>
+      <xs:enumeration value="dotted"/>
+      <xs:enumeration value="dashed"/>
+      <xs:enumeration value="double"/>
+      <xs:enumeration value="groove"/>
+      <xs:enumeration value="ridge"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name="borderDef">
+    <xs:restriction base="xs:string">
+      <!-- TODO refine me: \w+ will not be good enough for CMYK color, for example
+      <xs:pattern value="\((solid|dotted|dashed|double|groove|ridge|inset|outset),\w+,\d+(,collapse-(inner|outer))?"/>
+      -->
+      <xs:pattern value="\((solid|dotted|dashed|double|groove|ridge|inset|outset),.+)"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name="lengthListType">
+    <xs:list itemType="mf:lengthType"/>
+  </xs:simpleType>
+  <xs:simpleType name="rectangleType">
+    <xs:restriction base="mf:lengthListType">
+      <xs:length value="4"/>
+    </xs:restriction>
+  </xs:simpleType>
 </xs:schema>

Modified: xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd (original)
+++ xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/fop-intermediate-format-ng.xsd Sun Feb 22 12:40:44 2009
@@ -18,111 +18,73 @@
 <!-- $Id$ -->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
   targetNamespace="http://xmlgraphics.apache.org/fop/intermediate"
-  xmlns:mf="http://xmlgraphics.apache.org/fop/intermediate">
+  xmlns:mf="http://xmlgraphics.apache.org/fop/intermediate"
+  xmlns:nav="http://xmlgraphics.apache.org/fop/intermediate/document-navigation">
+  <xs:import namespace="http://xmlgraphics.apache.org/fop/intermediate/document-navigation"
+    schemaLocation="fop-intermediate-format-ng-nav.xsd"/>
   <xs:import namespace="adobe:ns:meta/" schemaLocation="xmp-metadata.xsd"/>
+  <xs:import namespace="http://xmlgraphics.apache.org/fop/intermediate/document-navigation"
+    schemaLocation="fop-intermediate-format-ng-nav.xsd"/>
   <xs:include schemaLocation="fop-intermediate-format-ng-datatypes.xsd"/>
   <xs:include schemaLocation="fop-intermediate-format-ng-content.xsd"/>
   <xs:element name="document">
     <xs:complexType>
       <xs:sequence>
         <xs:element ref="mf:header"/>
-        <xs:element ref="mf:page-sequence"/>
+        <xs:element ref="mf:page-sequence" minOccurs="1" maxOccurs="unbounded"/>
+        <xs:element ref="mf:trailer"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>
   <xs:element name="header">
     <xs:complexType>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:element ref="x:xmpmeta" xmlns:x="adobe:ns:meta/"/>
-        <xs:element ref="mf:bookmark-tree"/>
+        <!--xs:element ref="x:xmpmeta" xmlns:x="adobe:ns:meta/"/-->
+        <xs:any namespace="##other" processContents="lax"/>
       </xs:choice>
     </xs:complexType>
   </xs:element>
-  <xs:element name="bookmark-tree">
+  <xs:element name="trailer">
     <xs:complexType>
-      <xs:sequence minOccurs="1" maxOccurs="unbounded">
-        <xs:element ref="mf:bookmark"/>
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="bookmark">
-    <xs:complexType>
-      <xs:sequence minOccurs="1" maxOccurs="1">
-        <xs:element name="bookmark-title">
-          <xs:complexType>
-            <xs:simpleContent>
-              <xs:extension base="xs:string">
-                <xs:attribute name="color" type="mf:colorType"/>
-                <xs:attribute name="font-style">
-                  <xs:simpleType>
-                    <xs:restriction base="xs:string">
-                      <xs:enumeration value="normal"/>
-                      <xs:enumeration value="italic"/>
-                    </xs:restriction>
-                  </xs:simpleType>
-                </xs:attribute>
-                <xs:attribute name="font-weight">
-                  <xs:simpleType>
-                    <xs:restriction base="xs:string">
-                      <xs:enumeration value="normal"/>
-                      <xs:enumeration value="bold"/>
-                    </xs:restriction>
-                  </xs:simpleType>
-                </xs:attribute>
-              </xs:extension>
-            </xs:simpleContent>
-          </xs:complexType>
-        </xs:element>
-        <xs:element ref="mf:bookmark" maxOccurs="unbounded" minOccurs="0"/>
-      </xs:sequence>
-      <xs:attribute name="external-destination" type="xs:anyURI"/>
-      <xs:attribute name="internal-destination" type="xs:NCName">
-      </xs:attribute>
-      <xs:attribute name="starting-state">
-        <xs:simpleType>
-          <xs:restriction base="xs:string">
-            <xs:enumeration value="show"/>
-            <xs:enumeration value="hide"/>
-          </xs:restriction>
-        </xs:simpleType>
-      </xs:attribute>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <!--xs:element ref="nav:bookmark-tree"/-->
+        <xs:any namespace="##other" processContents="lax"/>
+      </xs:choice>
     </xs:complexType>
   </xs:element>
   <xs:element name="page-sequence">
     <xs:complexType>
       <xs:sequence>
-        <xs:element ref="mf:page"/>
+        <xs:element ref="mf:page" minOccurs="1" maxOccurs="unbounded"/>
       </xs:sequence>
       <xs:attribute name="id" type="xs:ID"/>
+      <xs:attributeGroup ref="mf:foreignAtts"/>
     </xs:complexType>
   </xs:element>
   <xs:element name="page">
     <xs:complexType>
       <xs:sequence>
-        <xs:element name="page-header">
-          <xs:complexType>
-            <xs:choice minOccurs="1" maxOccurs="unbounded">
-              <xs:any processContents="skip"/>
-            </xs:choice>
-          </xs:complexType>
-        </xs:element>
+        <xs:element name="page-header" type="mf:anyContent"/>
         <xs:element name="content" type="mf:contentType"/>
         <xs:element name="page-trailer" minOccurs="0">
           <xs:complexType>
-            <xs:sequence>
-              <xs:element name="target" minOccurs="0" maxOccurs="unbounded">
-                <xs:complexType>
-                  <xs:attribute name="x" use="required" type="xs:integer"/>
-                  <xs:attribute name="y" use="required" type="xs:integer"/>
-                  <xs:attribute name="name" use="required" type="xs:ID"/>
-                </xs:complexType>
-              </xs:element>
-            </xs:sequence>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="nav:link"/>
+              <xs:element ref="nav:goto-xy"/>
+            </xs:choice>
           </xs:complexType>
         </xs:element>
       </xs:sequence>
       <xs:attribute name="index" type="xs:nonNegativeInteger" use="required"/>
       <xs:attribute name="name" type="xs:string"/>
+      <xs:attribute name="page-master-name" type="xs:string"/>
+      <xs:attributeGroup ref="mf:sizeAtts"/>
+      <xs:attributeGroup ref="mf:foreignAtts"/>
     </xs:complexType>
   </xs:element>
+  <xs:complexType name="anyContent">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:any namespace="##other" processContents="lax"/>
+    </xs:choice>
+  </xs:complexType>
 </xs:schema>

Modified: xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.fop.render.Renderer
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.fop.render.Renderer?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.fop.render.Renderer (original)
+++ xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.fop.render.Renderer Sun Feb 22 12:40:44 2009
@@ -7,4 +7,4 @@
 org.apache.fop.render.awt.AWTRendererMaker
 org.apache.fop.render.print.PrintRendererMaker
 org.apache.fop.render.afp.AFPRendererMaker
-org.apache.fop.render.pcl.PCLRendererMaker
+org.apache.fop.render.pcl.PCLRendererMaker
\ No newline at end of file

Propchange: xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.fop.render.intermediate.IFDocumentHandler
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter (original)
+++ xmlgraphics/fop/trunk/src/java/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter Sun Feb 22 12:40:44 2009
@@ -1,2 +1,3 @@
 org.apache.fop.image.loader.batik.ImageConverterSVG2G2D
+org.apache.fop.image.loader.batik.ImageConverterG2D2SVG
 org.apache.fop.image.loader.batik.ImageConverterWMF2G2D

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPBorderPainter.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPConstants.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPDataObjectFactory.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPDataObjectInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPEventProducer.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java Sun Feb 22 12:40:44 2009
@@ -57,6 +57,7 @@
 import org.apache.xmlgraphics.java2d.TextHandler;
 import org.apache.xmlgraphics.ps.ImageEncodingHelper;
 import org.apache.xmlgraphics.util.MimeConstants;
+import org.apache.xmlgraphics.util.UnitConv;
 
 import org.apache.fop.afp.goca.GraphicsSetLineType;
 import org.apache.fop.afp.modca.GraphicsObject;
@@ -236,6 +237,32 @@
         this.gc = gc;
     }
 
+    private int getResolution() {
+        return this.paintingState.getResolution();
+    }
+
+    /**
+     * Converts a length value to an absolute value.
+     * Please note that this only uses the "ScaleY" factor, so this will result
+     * in a bad value should "ScaleX" and "ScaleY" be different.
+     * @param length the length
+     * @return the absolute length
+     */
+    public double convertToAbsoluteLength(double length) {
+        AffineTransform current = getTransform();
+        double mult = getResolution() / (double)UnitConv.IN2PT;
+        double factor = -current.getScaleY() / mult;
+        return length * factor;
+    }
+
+    /** IBM's AFP Workbench paints lines that are wider than expected. We correct manually. */
+    private static final double GUESSED_WIDTH_CORRECTION = 1.7;
+
+    private static final double SPEC_NORMAL_LINE_WIDTH = UnitConv.in2pt(0.01); //"approx" 0.01 inch
+    private static final double NORMAL_LINE_WIDTH
+        = SPEC_NORMAL_LINE_WIDTH * GUESSED_WIDTH_CORRECTION;
+
+
     /**
      * Apply the stroke to the AFP graphics object.
      * This takes the java stroke and outputs the appropriate settings
@@ -249,7 +276,17 @@
 
             // set line width
             float lineWidth = basicStroke.getLineWidth();
-            graphicsObj.setLineWidth(Math.round(lineWidth / 2));
+            if (false) {
+                //Old approach. Retained until verified problems with 1440 resolution
+                graphicsObj.setLineWidth(Math.round(lineWidth / 2));
+            } else {
+                double absoluteLineWidth = lineWidth * Math.abs(getTransform().getScaleY());
+                double multiplier = absoluteLineWidth / NORMAL_LINE_WIDTH;
+                graphicsObj.setLineWidth((int)Math.round(multiplier));
+                //TODO Use GSFLW instead of GSLW for higher accuracy?
+            }
+
+            //No line join, miter limit and end cap support in GOCA. :-(
 
             // set line type/style (note: this is an approximation at best!)
             float[] dashArray = basicStroke.getDashArray();
@@ -689,7 +726,7 @@
     /** {@inheritDoc} */
     public void addNativeImage(org.apache.xmlgraphics.image.loader.Image image,
             float x, float y, float width, float height) {
-        log.debug("NYI: addNativeImage() "+ "image=" + image
+        log.debug("NYI: addNativeImage() " + "image=" + image
                 + ",x=" + x + ",y=" + y + ",width=" + width + ",height=" + height);
     }
 

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphics2D.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPGraphicsObjectInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPImageObjectInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPLineDataInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPObjectAreaInfo.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java Sun Feb 22 12:40:44 2009
@@ -19,8 +19,11 @@
 
 package org.apache.fop.afp;
 
+import java.awt.Point;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
 import org.apache.fop.afp.fonts.AFPPageFonts;
 import org.apache.fop.util.AbstractPaintingState;
 
@@ -53,7 +56,7 @@
     private int resolution = 240; // 240 dpi
 
     /** the current page */
-    private AFPPagePaintingState pagePaintingState = new AFPPagePaintingState();
+    private transient AFPPagePaintingState pagePaintingState = new AFPPagePaintingState();
 
 //    /** reference orientation */
 //    private int orientation = 0;
@@ -313,6 +316,37 @@
         return this.unitConv;
     }
 
+    /**
+     * Returns a point on the current page, taking the current painting state into account.
+     *
+     * @param x the X-coordinate
+     * @param y the Y-coordinate
+     * @return a point on the current page
+     */
+    public Point getPoint(int x, int y) {
+        Point p = new Point();
+        int rotation = getRotation();
+        switch (rotation) {
+        case 90:
+            p.x = y;
+            p.y = getPageWidth() - x;
+            break;
+        case 180:
+            p.x = getPageWidth() - x;
+            p.y = getPageHeight() - y;
+            break;
+        case 270:
+            p.x = getPageHeight() - y;
+            p.y = x;
+            break;
+        default:
+            p.x = x;
+            p.y = y;
+            break;
+        }
+        return p;
+    }
+
     /** {@inheritDoc} */
     public Object clone() {
         AFPPaintingState paintingState = (AFPPaintingState)super.clone();

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPPaintingState.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPRectanglePainter.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceLevel.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceManager.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceManager.java Sun Feb 22 12:40:44 2009
@@ -21,19 +21,32 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.fop.afp.modca.AbstractNamedAFPObject;
 import org.apache.fop.afp.modca.AbstractPageObject;
 import org.apache.fop.afp.modca.IncludeObject;
+import org.apache.fop.afp.modca.IncludedResourceObject;
 import org.apache.fop.afp.modca.PageSegment;
 import org.apache.fop.afp.modca.Registry;
 import org.apache.fop.afp.modca.ResourceGroup;
+import org.apache.fop.afp.modca.ResourceObject;
+import org.apache.fop.afp.util.ResourceAccessor;
+import org.apache.fop.afp.util.SimpleResourceAccessor;
 
 /**
  * Manages the creation and storage of document resources
  */
 public class AFPResourceManager {
+
+    /** logging instance */
+    private static Log log = LogFactory.getLog(AFPResourceManager.class);
+
     /** The AFP datastream (document tree) */
     private DataStream dataStream;
 
@@ -47,8 +60,8 @@
     /** Maintain a reference count of instream objects for referencing purposes */
     private int instreamObjectCount = 0;
 
-    /** a mapping of resourceInfo --> names of includable objects */
-    private final Map/*<AFPResourceInfo,String>*/ includableObjectsMap
+    /** a mapping of resourceInfo --> include name */
+    private final Map/*<AFPResourceInfo,String>*/ includeNameMap
         = new java.util.HashMap()/*<AFPResourceInfo,String>*/;
 
     private Map pageSegmentMap = new java.util.HashMap();
@@ -120,7 +133,7 @@
         AFPResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
         updateResourceInfoUri(resourceInfo);
 
-        String objectName = (String)includableObjectsMap.get(resourceInfo);
+        String objectName = (String)includeNameMap.get(resourceInfo);
         if (objectName != null) {
             // an existing data resource so reference it by adding an include to the current page
             includeObject(dataObjectInfo, objectName);
@@ -156,35 +169,35 @@
         useInclude &= resourceGroup != null;
         if (useInclude) {
 
-            boolean usePageSegment = dataObjectInfo.isCreatePageSegment();
-
-            // if it is to reside within a resource group at print-file or external level
-            if (resourceLevel.isPrintFile() || resourceLevel.isExternal()) {
-                if (usePageSegment) {
-                    String pageSegmentName = "S10" + namedObj.getName().substring(3);
-                    namedObj.setName(pageSegmentName);
-                    PageSegment seg = new PageSegment(pageSegmentName);
-                    seg.addObject(namedObj);
-                    namedObj = seg;
-                }
+        boolean usePageSegment = dataObjectInfo.isCreatePageSegment();
 
-                // wrap newly created data object in a resource object
-                namedObj = dataObjectFactory.createResource(namedObj, resourceInfo, objectType);
+        // if it is to reside within a resource group at print-file or external level
+        if (resourceLevel.isPrintFile() || resourceLevel.isExternal()) {
+            if (usePageSegment) {
+                String pageSegmentName = "S10" + namedObj.getName().substring(3);
+                namedObj.setName(pageSegmentName);
+                PageSegment seg = new PageSegment(pageSegmentName);
+                seg.addObject(namedObj);
+                namedObj = seg;
             }
 
-            // add data object into its resource group destination
-            resourceGroup.addObject(namedObj);
+            // wrap newly created data object in a resource object
+            namedObj = dataObjectFactory.createResource(namedObj, resourceInfo, objectType);
+        }
 
-            // create the include object
-            objectName = namedObj.getName();
-            if (usePageSegment) {
-                includePageSegment(dataObjectInfo, objectName);
-                pageSegmentMap.put(resourceInfo, objectName);
-            } else {
-                includeObject(dataObjectInfo, objectName);
-                // record mapping of resource info to data object resource name
-                includableObjectsMap.put(resourceInfo, objectName);
-            }
+        // add data object into its resource group destination
+        resourceGroup.addObject(namedObj);
+
+        // create the include object
+        objectName = namedObj.getName();
+        if (usePageSegment) {
+            includePageSegment(dataObjectInfo, objectName);
+            pageSegmentMap.put(resourceInfo, objectName);
+        } else {
+            includeObject(dataObjectInfo, objectName);
+            // record mapping of resource info to data object resource name
+            includeNameMap.put(resourceInfo, objectName);
+        }
 
         } else {
             // not to be included so inline data object directly into the current page
@@ -206,10 +219,10 @@
 
     private void includeObject(AFPDataObjectInfo dataObjectInfo,
             String objectName) {
-        IncludeObject includeObject
-            = dataObjectFactory.createInclude(objectName, dataObjectInfo);
-        dataStream.getCurrentPage().addObject(includeObject);
-    }
+            IncludeObject includeObject
+                = dataObjectFactory.createInclude(objectName, dataObjectInfo);
+            dataStream.getCurrentPage().addObject(includeObject);
+        }
 
     private void includePageSegment(AFPDataObjectInfo dataObjectInfo,
             String pageSegmentName) {
@@ -221,6 +234,53 @@
     }
 
     /**
+     * Creates an included resource object by loading the contained object from a file.
+     * @param resourceName the name of the resource
+     * @param basePath the base path in which to look for the resource files
+     * @param resourceObjectType the resource object type ({@link ResourceObject}.*)
+     * @throws IOException if an I/O error occurs while loading the resource
+     */
+    public void createIncludedResource(String resourceName, String basePath,
+                byte resourceObjectType) throws IOException {
+        AFPResourceLevel resourceLevel = new AFPResourceLevel(AFPResourceLevel.PRINT_FILE);
+        URI uri;
+        try {
+            uri = new URI(resourceName.trim());
+        } catch (URISyntaxException e) {
+            throw new IOException("Could not create URI from resource name: " + resourceName
+                    + " (" + e.getMessage() + ")");
+        }
+
+        AFPResourceInfo resourceInfo = new AFPResourceInfo();
+        resourceInfo.setLevel(resourceLevel);
+        resourceInfo.setName(resourceName);
+        resourceInfo.setUri(uri.toASCIIString());
+
+        String objectName = (String)includeNameMap.get(resourceInfo);
+        if (objectName == null) {
+            if (log.isDebugEnabled()) {
+                log.debug("Adding included resource: " + resourceName);
+            }
+            //TODO This works with local filenames only. In the long term, this
+            //should work through FOP's URI resolver.
+            ResourceAccessor accessor = new SimpleResourceAccessor(basePath);
+            IncludedResourceObject resourceContent = new IncludedResourceObject(
+                        resourceName, accessor, uri);
+
+            ResourceObject resourceObject = factory.createResource(resourceName);
+            resourceObject.setDataObject(resourceContent);
+            resourceObject.setType(resourceObjectType);
+
+            ResourceGroup resourceGroup = streamer.getResourceGroup(resourceLevel);
+            resourceGroup.addObject(resourceObject);
+            // record mapping of resource info to data object resource name
+            includeNameMap.put(resourceInfo, resourceName);
+        } else {
+            //skip, already created
+        }
+    }
+
+    /**
      * Sets resource level defaults. The existing defaults over merged with the ones passed in
      * as parameter.
      * @param defaults the new defaults
@@ -236,4 +296,5 @@
     public AFPResourceLevelDefaults getResourceLevelDefaults() {
         return this.resourceLevelDefaults;
     }
-}
\ No newline at end of file
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceManager.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPStreamer.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPTextDataInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPUnitConverter.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AbstractAFPPainter.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/BorderPaintingInfo.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java Sun Feb 22 12:40:44 2009
@@ -340,27 +340,7 @@
      * @return a point on the current page
      */
     private Point getPoint(int x, int y) {
-        Point p = new Point();
-        int rotation = paintingState.getRotation();
-        switch (rotation) {
-        case 90:
-            p.x = y;
-            p.y = currentPage.getWidth() - x;
-            break;
-        case 180:
-            p.x = currentPage.getWidth() - x;
-            p.y = currentPage.getHeight() - y;
-            break;
-        case 270:
-            p.x = currentPage.getHeight() - y;
-            p.y = x;
-            break;
-        default:
-            p.x = x;
-            p.y = y;
-            break;
-        }
-        return p;
+        return paintingState.getPoint(x, y);
     }
 
     /**

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/Factory.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/PaintingInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/RectanglePaintingInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/Streamable.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/StructuredData.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFont.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFont.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFont.java Sun Feb 22 12:40:44 2009
@@ -97,13 +97,12 @@
      */
     public abstract CharacterSet getCharacterSet(int size);
 
-     /**
-     * Determines whether this font contains a particular character/glyph.
-     * @param c character to check
-     * @return True if the character is supported, False otherwise
+    /**
+     * Indicates if this font may be embedded.
+     * @return True, if embedding is possible/permitted
      */
-    public boolean hasChar(char c) {
-        return true;
+    public boolean isEmbeddable() {
+        return false; //TODO Complete AFP font embedding
     }
 
     /** {@inheritDoc} */

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFont.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFontAttributes.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFontCollection.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFontInfo.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPFontReader.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/AFPPageFonts.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSet.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSet.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSet.java Sun Feb 22 12:40:44 2009
@@ -21,10 +21,17 @@
 
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CodingErrorAction;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
 import org.apache.fop.afp.AFPConstants;
 import org.apache.fop.afp.util.StringUtils;
 
@@ -65,6 +72,9 @@
     /** The encoding used for the code page */
     protected String encoding;
 
+    /** The charset encoder corresponding to this encoding */
+    private CharsetEncoder encoder;
+
     /** The character set relating to the font */
     protected String name;
 
@@ -104,6 +114,8 @@
         }
         this.codePage = codePage;
         this.encoding = encoding;
+        this.encoder = Charset.forName(encoding).newEncoder();
+        this.encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
         this.path = path;
 
         this.characterSetOrientations = new java.util.HashMap(4);
@@ -304,6 +316,33 @@
     }
 
     /**
+     * Indicates whether the given char in the character set.
+     * @param c the character to check
+     * @return true if the character is in the character set
+     */
+    public boolean hasChar(char c) {
+        return encoder.canEncode(c);
+    }
+
+    /**
+     * Encodes a character sequence to a byte array.
+     * @param chars the characters
+     * @return the encoded characters
+     * @throws CharacterCodingException if the encoding operation fails
+     */
+    public byte[] encodeChars(CharSequence chars) throws CharacterCodingException {
+        ByteBuffer bb = encoder.encode(CharBuffer.wrap(chars));
+        if (bb.hasArray()) {
+            return bb.array();
+        } else {
+            bb.rewind();
+            byte[] bytes = new byte[bb.remaining()];
+            bb.get(bytes);
+            return bytes;
+        }
+    }
+
+    /**
      * Map a Unicode character to a code point in the font.
      * The code tables are already converted to Unicode therefore
      * we can use the identity mapping.
@@ -312,6 +351,7 @@
      * @return the mapped character
      */
     public char mapChar(char c) {
+        //TODO This is not strictly correct but we'll let it be for the moment
         return c;
     }
 

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSet.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java Sun Feb 22 12:40:44 2009
@@ -41,16 +41,6 @@
 public class CharacterSetOrientation {
 
     /**
-     * The code page to which the character set relates
-     */
-    private String codePage;
-
-    /**
-     * The encoding used for the code page
-     */
-    private String encoding;
-
-    /**
      * The ascender height for the character set
      */
     private int ascender;
@@ -66,9 +56,9 @@
     private int capHeight;
 
     /**
-     * The characters in the charcater set
+     * The character widths in the character set
      */
-    private int[] chars = new int[256];
+    private int[] charsWidths = new int[256];
 
     /**
      * The height of lowercase letters
@@ -166,8 +156,8 @@
      * @return the widths of all characters
      */
     public int[] getWidths() {
-        int arr[] = new int[(getLastChar() - getFirstChar()) + 1];
-        System.arraycopy(chars, getFirstChar(), arr, 0, (getLastChar() - getFirstChar()) + 1);
+        int[] arr = new int[(getLastChar() - getFirstChar()) + 1];
+        System.arraycopy(charsWidths, getFirstChar(), arr, 0, (getLastChar() - getFirstChar()) + 1);
         return arr;
     }
 
@@ -187,11 +177,11 @@
      * @return the widths of the character
      */
     public int getWidth(int characterIndex) {
-        if (characterIndex >= chars.length) {
+        if (characterIndex >= charsWidths.length) {
             throw new IllegalArgumentException("Invalid character index: "
-                    + characterIndex + ", maximum is " + (chars.length - 1));
+                    + characterIndex + ", maximum is " + (charsWidths.length - 1));
         }
-        return chars[characterIndex];
+        return charsWidths[characterIndex];
     }
 
     /**
@@ -253,14 +243,13 @@
      * @param width the widths of the character
      */
     public void setWidth(int character, int width) {
-
-        if (character >= chars.length) {
+        if (character >= charsWidths.length) {
             // Increase the size of the array if necessary
-            int arr[] = new int[(character - firstChar) + 1];
-            System.arraycopy(chars, 0, arr, 0, chars.length);
-            chars = arr;
+            int[] arr = new int[(character - firstChar) + 1];
+            System.arraycopy(charsWidths, 0, arr, 0, charsWidths.length);
+            charsWidths = arr;
         }
-        chars[character] = width;
+        charsWidths[character] = width;
 
     }
 

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/FontRuntimeException.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java Sun Feb 22 12:40:44 2009
@@ -166,6 +166,11 @@
         return getWidths(1000);
     }
 
+    /** {@inheritDoc} */
+    public boolean hasChar(char c) {
+        return charSet.hasChar(c);
+    }
+
     /**
      * Map a Unicode character to a code point in the font.
      * @param c character to map
@@ -179,4 +184,5 @@
     public String getEncodingName() {
         return charSet.getEncoding();
     }
+
 }
\ No newline at end of file

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java Sun Feb 22 12:40:44 2009
@@ -221,6 +221,11 @@
         return getWidths(1000);
     }
 
+    /** {@inheritDoc} */
+    public boolean hasChar(char c) {
+        return charSet.hasChar(c);
+    }
+
     /**
      * Map a Unicode character to a code point in the font.
      * @param c character to map

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsBox.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsChainedSegment.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsCharacterString.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsData.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsFillet.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsFullArc.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsImage.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsLine.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsSetArcParameters.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsSetCharacterSet.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsSetCurrentPosition.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsSetLineType.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsSetLineWidth.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsSetMix.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsSetPatternSymbol.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ioca/ImageCellPosition.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ioca/ImageContent.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ioca/ImageInputDescriptor.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ioca/ImageOutputControl.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ioca/ImageRasterData.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ioca/ImageRasterPattern.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ioca/ImageSegment.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ioca/ImageSizeParameter.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractDataObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractDescriptor.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java Sun Feb 22 12:40:44 2009
@@ -35,7 +35,7 @@
  * page has a set of data objects associated with it. Each page within a
  * document is independent from any other page, and each must establish its own
  * environment parameters.
- *
+ * <p>
  * The page is the level in the document component hierarchy that is used for
  * printing or displaying a document's content. The data objects contained in
  * the page envelope in the data stream are presented when the page is
@@ -43,12 +43,11 @@
  * directs the placement and orientation of the data on the page. In addition,
  * each page contains layout information that specifies the measurement units,
  * page width, and page depth.
- *
+ * <p>
  * A page is initiated by a begin page structured field and terminated by an end
  * page structured field. Structured fields that define objects and active
  * environment groups or that specify attributes of the page may be encountered
  * in page state.
- *
  */
 public abstract class AbstractPageObject extends AbstractNamedAFPObject implements Completable {
 
@@ -202,7 +201,7 @@
      *
      * @return the presentation text object
      */
-    private PresentationTextObject getPresentationTextObject() {
+    public PresentationTextObject getPresentationTextObject() {
         if (currentPresentationTextObject == null) {
             PresentationTextObject presentationTextObject
                 = factory.createPresentationTextObject();

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractResourceEnvironmentGroupContainer.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractStructuredObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/ContainerDataDescriptor.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/Document.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/GraphicsDataDescriptor.java
            ('svn:mergeinfo' removed)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/GraphicsObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/GraphicsObject.java?rev=746664&r1=746663&r2=746664&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/GraphicsObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/GraphicsObject.java Sun Feb 22 12:40:44 2009
@@ -179,20 +179,20 @@
     }
 
     /**
-     * Sets whether the following shape is to be filled
+     * Sets whether the following shape is to be filled.
      *
      * @param fill true if the following shape is to be filled
      */
     public void setFill(boolean fill) {
-        setPatternSymbol(fill ?
-                GraphicsSetPatternSymbol.SOLID_FILL :
-                    GraphicsSetPatternSymbol.NO_FILL);
+        setPatternSymbol(fill
+                ? GraphicsSetPatternSymbol.SOLID_FILL
+                : GraphicsSetPatternSymbol.NO_FILL);
     }
 
     /**
-     * Sets the fill pattern of the next shape
+     * Sets the fill pattern of the next shape.
      *
-     * @param the fill pattern of the next shape
+     * @param patternSymbol the fill pattern of the next shape
      */
     public void setPatternSymbol(byte patternSymbol) {
         if (patternSymbol != graphicsState.patternSymbol) {
@@ -332,6 +332,7 @@
      */
     public void newSegment() {
         getData().newSegment();
+        graphicsState.lineWidth = 0; //Looks like a new segment invalidates the graphics state
     }
 
     /** {@inheritDoc} */
@@ -366,7 +367,7 @@
     }
 
     /** the internal graphics state */
-    private class GraphicsState {
+    private static class GraphicsState {
         /** the current color */
         private Color color;
 

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/GraphicsObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/IMImageObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/ImageDataDescriptor.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/ImageObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/IncludeObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/IncludePageOverlay.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/IncludePageSegment.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/InterchangeSet.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/InvokeMediumMap.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/MapCodedFont.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/MapContainerData.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/MapDataResource.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/MapPageOverlay.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/MaximumSizeExceededException.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/NoOperation.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/ObjectAreaDescriptor.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/ObjectAreaPosition.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/ObjectContainer.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/ObjectEnvironmentGroup.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/Overlay.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageDescriptor.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageSegment.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java
            ('svn:mergeinfo' removed)

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PresentationEnvironmentControl.java
            ('svn:mergeinfo' removed)



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