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 sp...@apache.org on 2011/02/11 12:59:35 UTC

svn commit: r1069764 [1/7] - in /xmlgraphics/fop/branches/Temp_ComplexScripts: ./ lib/ lib/build/ src/codegen/java/org/apache/fop/tools/ src/documentation/content/xdocs/trunk/ src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/apps/ src/java/org/...

Author: spepping
Date: Fri Feb 11 11:59:32 2011
New Revision: 1069764

URL: http://svn.apache.org/viewvc?rev=1069764&view=rev
Log:
merge from trunk

Added:
    xmlgraphics/fop/branches/Temp_ComplexScripts/lib/build/qdox-1.12.jar
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/lib/build/qdox-1.12.jar
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/CIELabColorFunction.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/CIELabColorFunction.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/NamedColorFunction.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NamedColorFunction.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/TextDecorationMaker.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/TextDecorationMaker.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/URIProperty.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/URIProperty.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java
      - copied, changed from r1069711, xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFCIELabColorSpace.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFCIELabColorSpace.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFColorHandler.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFColorHandler.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFSeparationColorSpace.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFSeparationColorSpace.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/ColorWithFallback.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorWithFallback.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/fotree/testcases/xml_base.fo
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/fotree/testcases/xml_base.fo
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/AbstractRenderingTestCase.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/AbstractRenderingTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/afp/
      - copied from r1069734, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/afp/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/afp/AFPTestSuite.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/afp/AFPTestSuite.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/afp/AbstractAFPTestCase.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/afp/AbstractAFPTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/afp/NoOperationTestCase.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/afp/NoOperationTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/afp/nops.fo
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/afp/nops.fo
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/ps/PSTestSuite.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/ps/PSTestSuite.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/util/BitmapImageUtilTestCase.java
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/java/org/apache/fop/util/BitmapImageUtilTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/color/
      - copied from r1069734, xmlgraphics/fop/trunk/test/resources/color/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/color/ncp-example.icc
      - copied unchanged from r1069734, xmlgraphics/fop/trunk/test/resources/color/ncp-example.icc
Removed:
    xmlgraphics/fop/branches/Temp_ComplexScripts/lib/build/qdox-1.6.3.jar
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java
Modified:
    xmlgraphics/fop/branches/Temp_ComplexScripts/   (props changed)
    xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/lib/xmlgraphics-commons-1.5svn.jar
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/fonts.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/DataStream.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/apps/   (props changed)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractPageObject.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/GraphicsObject.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/NoOperation.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/Overlay.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageGroup.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageObject.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/parser/   (props changed)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/apps/FopFactory.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeHandler.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/Constants.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/PropertyList.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyParser.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ColorProperty.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ListProperty.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/LMiter.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/PositionIterator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/SpaceResolver.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/TraitSetter.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/AlignmentContext.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFColor.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFDeviceColorSpace.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFDocument.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFFactory.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFName.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFPaintingState.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFResources.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/afp/extensions/AFPPageSetupElement.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/intermediate/IFSerializer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/intermediate/IFState.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pcl/PCLGenerator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pcl/PCLImageHandlerGraphics2D.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pcl/PCLRenderingMode.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pcl/PCLRenderingUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/xml/XMLRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/svg/PDFBridgeContext.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/svg/PDFGraphics2D.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/traits/BorderProps.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/AbstractPaintingState.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/ColorExt.java   (contents, props changed)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/ColorProfileUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/ColorSpaceCache.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/ColorUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/ListUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/bitmap/BitmapImageUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/status.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/StandardTestSuite.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/UtilityCodeTestSuite.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/ps/AbstractPostScriptTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/traits/BorderPropsTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/util/ColorUtilTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/layoutengine/standard-testcases/fox_disable-column-balancing.xml

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 11 11:59:32 2011
@@ -1,4 +1,5 @@
 /xmlgraphics/fop/branches/Temp_AreaTreeNewDesign:603620-746655
+/xmlgraphics/fop/branches/Temp_Color:956535-1069429
 /xmlgraphics/fop/branches/fop-0_95:684572,688085,688696
 /xmlgraphics/fop/branches/fop-1_0:959975-964707
-/xmlgraphics/fop/trunk:981451-1064159
+/xmlgraphics/fop/trunk:981451-1069734

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml Fri Feb 11 11:59:32 2011
@@ -747,6 +747,7 @@ list of possible build targets.
       <fileset dir="${test.dir}/java">
         <include name="META-INF/**"/>
         <include name="**/*.xml"/>
+        <include name="**/*.fo"/>
       </fileset>
       <fileset dir="${build.dir}/test-gensrc">
         <include name="**/*.xml"/>

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/lib/xmlgraphics-commons-1.5svn.jar
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/lib/xmlgraphics-commons-1.5svn.jar?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
Binary files - no diff available.

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java Fri Feb 11 11:59:32 2011
@@ -21,7 +21,6 @@ package org.apache.fop.tools;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -47,10 +46,10 @@ import com.thoughtworks.qdox.model.Type;
 class EventProducerCollector {
 
     private static final String CLASSNAME_EVENT_PRODUCER = EventProducer.class.getName();
-    private static final Map PRIMITIVE_MAP;
+    private static final Map<String, Class<?>> PRIMITIVE_MAP;
 
     static {
-        Map m = new java.util.HashMap();
+        Map <String, Class<?>> m = new java.util.HashMap<String, Class<?>>();
         m.put("boolean", Boolean.class);
         m.put("byte", Byte.class);
         m.put("char", Character.class);
@@ -63,7 +62,7 @@ class EventProducerCollector {
     }
 
     private DocletTagFactory tagFactory;
-    private List models = new ArrayList();
+    private List<EventModel> models = new java.util.ArrayList<EventModel>();
 
     /**
      * Creates a new EventProducerCollector.
@@ -139,7 +138,7 @@ class EventProducerCollector {
             throws EventConventionException, ClassNotFoundException {
         JavaClass clazz = method.getParentClass();
         //Check EventProducer conventions
-        if (!method.getReturns().isVoid()) {
+        if (!method.getReturnType().isVoid()) {
             throw new EventConventionException("All methods of interface "
                     + clazz.getFullyQualifiedName() + " must have return type 'void'!");
         }
@@ -168,10 +167,10 @@ class EventProducerCollector {
         if (params.length > 1) {
             for (int j = 1, cj = params.length; j < cj; j++) {
                 JavaParameter p = params[j];
-                Class type;
+                Class<?> type;
                 JavaClass pClass = p.getType().getJavaClass();
                 if (p.getType().isPrimitive()) {
-                    type = (Class)PRIMITIVE_MAP.get(pClass.getName());
+                    type = PRIMITIVE_MAP.get(pClass.getName());
                     if (type == null) {
                         throw new UnsupportedOperationException(
                                 "Primitive datatype not supported: " + pClass.getName());
@@ -197,7 +196,7 @@ class EventProducerCollector {
      * Returns the event model that has been accumulated.
      * @return the event model.
      */
-    public List getModels() {
+    public List<EventModel> getModels() {
         return this.models;
     }
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/fonts.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/fonts.xml?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/fonts.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/fonts.xml Fri Feb 11 11:59:32 2011
@@ -426,6 +426,21 @@
           Name: font/myfont.ttf
           Content-Type: application/x-font</source>
         <p>This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.</p>
+        <section id="font-cache">
+          <title>The font cache</title>
+          <p>
+            Apache FOP maintains a cache file that is used to speed up auto-detection. This file
+            is usually found in the ".fop" directory under the user's home directory. It's called
+            "fop-fonts.cache". When the user's home directory is not writable, the font cache file
+            is put in the directory for temporary files.
+          </p>
+          <p>
+            If there was a problem loading a particular font, it is flagged in the cache file so
+            it is not loaded anymore. So, if a font is actually around but is still not found
+            by Apache FOP, it's worth a try to delete the font cache file which forces Apache FOP
+            to reparse all fonts.
+          </p>
+        </section>
       </section>
       <section id="embedding">
         <title>Embedding</title>

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml Fri Feb 11 11:59:32 2011
@@ -931,9 +931,15 @@ Note that the value of the encoding attr
         </fo:simple-page-master>
       </fo:layout-master-set>
 ]]></source>
-        <p>The no-operation extension element can only occur within a simple-page-master.
-        Multiple no-operation extension elements within a simple-page-master are allowed.
-        The name attribute is mandatory.
+        <p>The no-operation extension element can appear as child of
+        simple-page-master (appears after "Begin Page" BPG),
+        page-sequence (appears after "Begin Named Page Group" BNG
+        and declarations (appears after "Begin Document" BDT).
+        Multiple no-operation extension elements inside the same formatting object are allowed.
+        Each NOP will appear right after the respective "Begin" field indicated above even if it
+        is specified as the last child under its parent. However, the order inside the parent
+        will be maintained.
+        The name attribute is mandatory but will not appear inside the AFP stream.
         </p>
       </section>
       <section id="afp-invoke-medium-map">

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/DataStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/DataStream.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/DataStream.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/DataStream.java Fri Feb 11 11:59:32 2011
@@ -595,7 +595,13 @@ public class DataStream {
      *            byte data
      */
     public void createNoOperation(String content) {
-        currentPage.createNoOperation(content);
+        if (currentPage != null) {
+            currentPage.createNoOperation(content);
+        } else if (currentPageGroup != null) {
+            currentPageGroup.createNoOperation(content);
+        } else {
+            document.createNoOperation(content);
+        }
     }
 
     /**
@@ -639,9 +645,9 @@ public class DataStream {
             currentPageGroup.endPageGroup();
             tleSequence = currentPageGroup.getTleSequence();
             document.addPageGroup(currentPageGroup);
-            document.writeToStream(outputStream);
             currentPageGroup = null;
         }
+        document.writeToStream(outputStream); //Flush objects
     }
 
     /**

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/apps/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 11 11:59:32 2011
@@ -1,5 +1,6 @@
 /xmlgraphics/commons/branches/commons-1_4/src/java/org/apache/xmlgraphics/afp/apps:950384-962801
 /xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/afp/apps:603620-746655
+/xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/afp/apps:956535-1069429
 /xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/afp/apps:684572,688085,688696
 /xmlgraphics/fop/branches/fop-1_0/src/java/org/apache/fop/afp/apps:959975-964707
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/apps:981451-1064159
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/apps:959946-1069734

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java Fri Feb 11 11:59:32 2011
@@ -21,9 +21,16 @@ package org.apache.fop.afp.goca;
 
 import java.awt.Color;
 import java.awt.color.ColorSpace;
+import java.io.DataOutput;
 import java.io.IOException;
 import java.io.OutputStream;
 
+import org.apache.commons.io.output.ByteArrayOutputStream;
+
+import org.apache.xmlgraphics.java2d.color.CIELabColorSpace;
+import org.apache.xmlgraphics.java2d.color.ColorUtil;
+import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives;
+
 /**
  * Sets the current processing color for the following GOCA structured fields
  */
@@ -37,56 +44,96 @@ public class GraphicsSetProcessColor ext
      * X'08' CIELAB
      * X'40' Standard OCA color space
      */
-    private static final byte RGB = 0x01, CMYK = 0x04;
+    private static final byte RGB = 0x01, CMYK = 0x04, CIELAB = 0x08;
 
     private final Color color;
-
-    private final float[] colorComponents;
+    private final int componentsSize;
 
     /**
      * Main constructor
      *
-     * @param color
-     *            the color to set
+     * @param color the color to set
      */
     public GraphicsSetProcessColor(Color color) {
-        this.color = color;
-        this.colorComponents = color.getColorComponents(null);
+        if (color instanceof ColorWithAlternatives) {
+            ColorWithAlternatives cwa = (ColorWithAlternatives)color;
+            Color alt = cwa.getFirstAlternativeOfType(ColorSpace.TYPE_CMYK);
+            if (alt != null) {
+                this.color = alt;
+                this.componentsSize = 4;
+                return;
+            }
+        }
+        ColorSpace cs = color.getColorSpace();
+        int colSpaceType = cs.getType();
+        if (colSpaceType == ColorSpace.TYPE_CMYK) {
+            this.color = color;
+        } else if (cs instanceof CIELabColorSpace) {
+            //TODO Convert between illuminants if not D50 according to rendering intents
+            //Right now, we're assuming D50 as the GOCA spec requires.
+            this.color = color;
+            //16bit components didn't work, and 8-bit sadly has reduced accuracy.
+        } else {
+            if (!color.getColorSpace().isCS_sRGB()) {
+                this.color = ColorUtil.toSRGBColor(color);
+            } else {
+                this.color = color;
+            }
+        }
+        this.componentsSize = this.color.getColorSpace().getNumComponents();
     }
 
     /** {@inheritDoc} */
     public int getDataLength() {
-        return 12 + colorComponents.length;
+        return 12 + this.componentsSize;
     }
 
     /** {@inheritDoc} */
+    @Override
     byte getOrderCode() {
         return (byte) 0xB2;
     }
 
     /** {@inheritDoc} */
     public void writeToStream(OutputStream os) throws IOException {
+        float[] colorComponents = color.getColorComponents(null);
 
         // COLSPCE
         byte colspace;
-        int colSpaceType = color.getColorSpace().getType();
+        ColorSpace cs = color.getColorSpace();
+        int colSpaceType = cs.getType();
+        ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        byte[] colsizes;
         if (colSpaceType == ColorSpace.TYPE_CMYK) {
             colspace = CMYK;
+            colsizes = new byte[] {0x08, 0x08, 0x08, 0x08};
+            for (int i = 0; i < colorComponents.length; i++) {
+                baout.write(Math.round(colorComponents[i] * 255));
+            }
         } else if (colSpaceType == ColorSpace.TYPE_RGB) {
             colspace = RGB;
+            colsizes = new byte[] {0x08, 0x08, 0x08, 0x00};
+            for (int i = 0; i < colorComponents.length; i++) {
+                baout.write(Math.round(colorComponents[i] * 255));
+            }
+        } else if (cs instanceof CIELabColorSpace) {
+            colspace = CIELAB;
+            colsizes = new byte[] {0x08, 0x08, 0x08, 0x00};
+            DataOutput dout = new java.io.DataOutputStream(baout);
+            //According to GOCA, I'd expect the multiplicator below to be 255f, not 100f
+            //But only IBM AFP Workbench seems to support Lab colors and it requires "c * 100f"
+            int l = Math.round(colorComponents[0] * 100f);
+            int a = Math.round(colorComponents[1] * 255f) - 128;
+            int b = Math.round(colorComponents[2] * 255f) - 128;
+            dout.writeByte(l);
+            dout.writeByte(a);
+            dout.writeByte(b);
         } else {
-            LOG.error("unsupported colorspace " + colSpaceType);
-            colspace = RGB;
-        }
-
-        // COLSIZE(S)
-        byte[] colsizes = new byte[] {0x00, 0x00, 0x00, 0x00};
-        for (int i = 0; i < colorComponents.length; i++) {
-            colsizes[i] = (byte) 8;
+            throw new IllegalStateException();
         }
 
         int len = getDataLength();
-        byte[] data = new byte[len];
+        byte[] data = new byte[12];
         data[0] = getOrderCode(); // GSPCOL order code
         data[1] = (byte) (len - 2); // LEN
         data[2] = 0x00; // reserved; must be zero
@@ -100,15 +147,12 @@ public class GraphicsSetProcessColor ext
         data[10] = colsizes[2];
         data[11] = colsizes[3];
 
-        // COLVALUE(S)
-        for (int i = 0; i < colorComponents.length; i++) {
-            data[i + 12] = (byte) (colorComponents[i] * 255);
-        }
-
         os.write(data);
+        baout.writeTo(os);
     }
 
     /** {@inheritDoc} */
+    @Override
     public String toString() {
         return "GraphicsSetProcessColor(col=" + color + ")";
     }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractPageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractPageObject.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractPageObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractPageObject.java Fri Feb 11 11:59:32 2011
@@ -57,11 +57,8 @@ public abstract class AbstractPageObject
     /** The current presentation text object */
     private PresentationTextObject currentPresentationTextObject = null;
 
-    /** The list of tag logical elements */
-    protected List/*<TagLogicalElement>*/ tagLogicalElements = null;
-
     /** The list of objects within this resource container */
-    protected List/*<AbstractStructuredAFPObject>*/ objects = new java.util.ArrayList();
+    protected List/*<AbstractStructuredObject>*/ objects = new java.util.ArrayList();
 
     /** The page width */
     private int width;
@@ -217,10 +214,10 @@ public abstract class AbstractPageObject
      * @return the TLEs
      */
     protected List getTagLogicalElements() {
-        if (tagLogicalElements == null) {
-            this.tagLogicalElements = new java.util.ArrayList/*<TagLogicalElement>*/();
+        if (objects == null) {
+            this.objects = new java.util.ArrayList/*<AbstractStructuredObject>*/();
         }
-        return this.tagLogicalElements;
+        return this.objects;
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java Fri Feb 11 11:59:32 2011
@@ -126,6 +126,7 @@ implements Streamable {
 //    }
 
     /** {@inheritDoc} */
+    @Override
     public void writeToStream(OutputStream os) throws IOException {
         if (!started) {
             writeStart(os);
@@ -140,6 +141,7 @@ implements Streamable {
     }
 
     /** {@inheritDoc} */
+    @Override
     protected void writeObjects(Collection/*<AbstractAFPObject>*/ objects, OutputStream os)
             throws IOException {
         writeObjects(objects, os, false);
@@ -176,7 +178,7 @@ implements Streamable {
      * @return true if this object can be written
      */
     protected boolean canWrite(AbstractAFPObject obj) {
-        if (obj instanceof AbstractPageObject) {
+        if (obj instanceof Completable) {
             return ((Completable)obj).isComplete();
         }
         else {

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/GraphicsObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/GraphicsObject.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/GraphicsObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/GraphicsObject.java Fri Feb 11 11:59:32 2011
@@ -26,6 +26,7 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.xmlgraphics.java2d.color.ColorConverter;
+import org.apache.xmlgraphics.java2d.color.ColorUtil;
 
 import org.apache.fop.afp.AFPDataObjectInfo;
 import org.apache.fop.afp.AFPObjectAreaInfo;
@@ -82,6 +83,7 @@ public class GraphicsObject extends Abst
     }
 
     /** {@inheritDoc} */
+    @Override
     public void setViewport(AFPDataObjectInfo dataObjectInfo) {
         super.setViewport(dataObjectInfo);
 
@@ -145,7 +147,7 @@ public class GraphicsObject extends Abst
      * @param color the active color to use
      */
     public void setColor(Color color) {
-        if (!color.equals(graphicsState.color)) {
+        if (!ColorUtil.isSameColor(color, graphicsState.color)) {
             addObject(new GraphicsSetProcessColor(colorConverter.convert(color)));
             graphicsState.color = color;
         }
@@ -341,6 +343,7 @@ public class GraphicsObject extends Abst
     }
 
     /** {@inheritDoc} */
+    @Override
     public String toString() {
         return "GraphicsObject: " + getName();
     }
@@ -354,6 +357,7 @@ public class GraphicsObject extends Abst
     }
 
     /** {@inheritDoc} */
+    @Override
     public void setComplete(boolean complete) {
         Iterator it = objects.iterator();
         while (it.hasNext()) {
@@ -364,6 +368,7 @@ public class GraphicsObject extends Abst
     }
 
     /** {@inheritDoc} */
+    @Override
     protected void writeStart(OutputStream os) throws IOException {
         super.writeStart(os);
         byte[] data = new byte[17];
@@ -372,12 +377,14 @@ public class GraphicsObject extends Abst
     }
 
     /** {@inheritDoc} */
+    @Override
     protected void writeContent(OutputStream os) throws IOException {
         super.writeContent(os);
         writeObjects(objects, os);
     }
 
     /** {@inheritDoc} */
+    @Override
     protected void writeEnd(OutputStream os) throws IOException {
         byte[] data = new byte[17];
         copySF(data, Type.END, Category.GRAPHICS);

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/NoOperation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/NoOperation.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/NoOperation.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/NoOperation.java Fri Feb 11 11:59:32 2011
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 
 import org.apache.fop.afp.AFPConstants;
+import org.apache.fop.afp.Completable;
 import org.apache.fop.afp.util.BinaryUtils;
 
 /**
@@ -35,7 +36,7 @@ import org.apache.fop.afp.util.BinaryUti
  * No Operation structured fields, no semantics should be attached to
  * the data carried by the No Operation structured field in interchange
  */
-public class NoOperation extends AbstractAFPObject {
+public class NoOperation extends AbstractAFPObject implements Completable {
 
     /** Up to 32759 bytes of data with no architectural definition */
     private static final int MAX_DATA_LEN = 32759;
@@ -81,7 +82,7 @@ public class NoOperation extends Abstrac
         data[1] = rl1[0];
         data[2] = rl1[1];
 
-        // Structured field ID for a TLE
+        // Structured field ID for a NOP
         data[3] = (byte) 0xD3;
         data[4] = (byte) 0xEE;
         data[5] = (byte) 0xEE;
@@ -97,4 +98,20 @@ public class NoOperation extends Abstrac
         os.write(data);
     }
 
+    /** {@inheritDoc} */
+    public boolean isComplete() {
+        return true; //always complete
+    }
+
+    /** {@inheritDoc} */
+    public void setComplete(boolean complete) {
+        //ignore
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String toString() {
+        return "NOP: " + content.substring(0, Math.min(64, content.length()));
+    }
+
 }
\ No newline at end of file

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/Overlay.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/Overlay.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/Overlay.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/Overlay.java Fri Feb 11 11:59:32 2011
@@ -72,7 +72,6 @@ public class Overlay extends PageObject 
 
         getActiveEnvironmentGroup().writeToStream(os);
 
-        writeObjects(tagLogicalElements, os);
         writeObjects(objects, os);
     }
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageGroup.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageGroup.java Fri Feb 11 11:59:32 2011
@@ -76,12 +76,6 @@ public class PageGroup extends AbstractR
     }
 
     /** {@inheritDoc} */
-    protected void writeContent(OutputStream os) throws IOException {
-        writeObjects(tagLogicalElements, os, true);
-        super.writeContent(os);
-    }
-
-    /** {@inheritDoc} */
     protected void writeStart(OutputStream os) throws IOException {
         byte[] data = new byte[17];
         copySF(data, Type.BEGIN, Category.PAGE_GROUP);

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageObject.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/PageObject.java Fri Feb 11 11:59:32 2011
@@ -185,7 +185,6 @@ public class PageObject extends Abstract
 
         getActiveEnvironmentGroup().writeToStream(os);
 
-        writeObjects(tagLogicalElements, os);
         writeObjects(objects, os);
     }
 

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/parser/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 11 11:59:32 2011
@@ -1,5 +1,6 @@
 /xmlgraphics/commons/branches/commons-1_4/src/java/org/apache/xmlgraphics/afp/parser:950384-962801
 /xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/afp/parser:603620-746655
+/xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/afp/parser:956535-1069429
 /xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/afp/parser:684572,688085,688696
 /xmlgraphics/fop/branches/fop-1_0/src/java/org/apache/fop/afp/parser:959975-964707
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser:981451-1064159
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser:959946-1069734

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java Fri Feb 11 11:59:32 2011
@@ -26,6 +26,10 @@ import java.io.OutputStream;
 
 import org.apache.commons.io.output.ByteArrayOutputStream;
 
+import org.apache.xmlgraphics.java2d.color.CIELabColorSpace;
+import org.apache.xmlgraphics.java2d.color.ColorUtil;
+import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives;
+
 /**
  * Generator class for PTOCA data structures.
  */
@@ -311,9 +315,18 @@ public abstract class PtocaBuilder imple
      * @throws IOException if an I/O error occurs
      */
     public void setExtendedTextColor(Color col) throws IOException {
-        if (col.equals(currentColor)) {
+        if (ColorUtil.isSameColor(col, currentColor)) {
             return;
         }
+        if (col instanceof ColorWithAlternatives) {
+            ColorWithAlternatives cwa = (ColorWithAlternatives)col;
+            Color alt = cwa.getFirstAlternativeOfType(ColorSpace.TYPE_CMYK);
+            if (alt != null) {
+                col = alt;
+            }
+        }
+        ColorSpace cs = col.getColorSpace();
+
         newControlSequence();
         if (col.getColorSpace().getType() == ColorSpace.TYPE_CMYK) {
             writeByte(0x00); // Reserved; must be zero
@@ -332,6 +345,25 @@ public abstract class PtocaBuilder imple
                 int component = Math.round(comps[i] * 255);
                 writeByte(component);
             }
+        } else if (cs instanceof CIELabColorSpace) {
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x08); // Color space - 0x08 = CIELAB
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(0x00); // Reserved; must be zero
+            writeByte(8); // Number of bits in component 1
+            writeByte(8); // Number of bits in component 2
+            writeByte(8); // Number of bits in component 3
+            writeByte(0); // Number of bits in component 4
+            //Sadly, 16 bit components don't seem to work
+            float[] colorComponents = col.getColorComponents(null);
+            int l = Math.round(colorComponents[0] * 255f);
+            int a = Math.round(colorComponents[1] * 255f) - 128;
+            int b = Math.round(colorComponents[2] * 255f) - 128;
+            writeByte(l); // L*
+            writeByte(a); // a*
+            writeByte(b); // b*
         } else {
             writeByte(0x00); // Reserved; must be zero
             writeByte(0x01); // Color space - 0x01 = RGB

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/apps/FopFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/apps/FopFactory.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/apps/FopFactory.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/apps/FopFactory.java Fri Feb 11 11:59:32 2011
@@ -19,7 +19,6 @@
 
 package org.apache.fop.apps;
 
-import java.awt.color.ColorSpace;
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -151,7 +150,7 @@ public class FopFactory implements Image
     /** Optional overriding LayoutManagerMaker */
     private LayoutManagerMaker lmMakerOverride = null;
 
-    private Set ignoredNamespaces;
+    private Set<String> ignoredNamespaces;
 
     private FOURIResolver foURIResolver;
 
@@ -165,6 +164,7 @@ public class FopFactory implements Image
         this.fontManager = new FontManager() {
 
             /** {@inheritDoc} */
+            @Override
             public void setFontBaseURL(String fontBase) throws MalformedURLException {
                 super.setFontBaseURL(getFOURIResolver().checkBaseURL(fontBase));
             }
@@ -175,7 +175,7 @@ public class FopFactory implements Image
         this.rendererFactory = new RendererFactory();
         this.xmlHandlers = new XMLHandlerRegistry();
         this.imageHandlers = new ImageHandlerRegistry();
-        this.ignoredNamespaces = new java.util.HashSet();
+        this.ignoredNamespaces = new java.util.HashSet<String>();
     }
 
     /**
@@ -381,6 +381,7 @@ public class FopFactory implements Image
      * @throws MalformedURLException if there's a problem with a file URL
      * @deprecated use getFontManager().setFontBaseURL(fontBase) instead
      */
+    @Deprecated
     public void setFontBaseURL(String fontBase) throws MalformedURLException {
         getFontManager().setFontBaseURL(fontBase);
     }
@@ -389,6 +390,7 @@ public class FopFactory implements Image
      * @return the font base URL
      * @deprecated use getFontManager().setFontBaseURL(fontBase) instead
      */
+    @Deprecated
     public String getFontBaseURL() {
         return getFontManager().getFontBaseURL();
     }
@@ -516,6 +518,7 @@ public class FopFactory implements Image
      * @return true if kerning on base 14 fonts is enabled
      * @deprecated use getFontManager().isBase14KerningEnabled() instead
      */
+    @Deprecated
     public boolean isBase14KerningEnabled() {
         return getFontManager().isBase14KerningEnabled();
     }
@@ -525,6 +528,7 @@ public class FopFactory implements Image
      * @param value true if kerning should be activated
      * @deprecated use getFontManager().setBase14KerningEnabled(boolean) instead
      */
+    @Deprecated
     public void setBase14KerningEnabled(boolean value) {
         getFontManager().setBase14KerningEnabled(value);
     }
@@ -652,7 +656,7 @@ public class FopFactory implements Image
      * namespace is in the ignored set.
      * @param namespaceURIs the namespace URIs
      */
-    public void ignoreNamespaces(Collection namespaceURIs) {
+    public void ignoreNamespaces(Collection<String> namespaceURIs) {
         this.ignoredNamespaces.addAll(namespaceURIs);
     }
 
@@ -666,7 +670,7 @@ public class FopFactory implements Image
     }
 
     /** @return the set of namespaces that are ignored by FOP */
-    public Set getIgnoredNamespace() {
+    public Set<String> getIgnoredNamespace() {
         return Collections.unmodifiableSet(this.ignoredNamespaces);
     }
 
@@ -742,6 +746,7 @@ public class FopFactory implements Image
      * @param useCache use cache or not
      * @deprecated use getFontManager().setUseCache(boolean) instead
      */
+    @Deprecated
     public void setUseCache(boolean useCache) {
         getFontManager().setUseCache(useCache);
     }
@@ -751,6 +756,7 @@ public class FopFactory implements Image
      * @return whether this factory is uses the cache
      * @deprecated use getFontManager().useCache() instead
      */
+    @Deprecated
     public boolean useCache() {
         return getFontManager().useCache();
     }
@@ -760,6 +766,7 @@ public class FopFactory implements Image
      * @return the font cache
      * @deprecated use getFontManager().getFontCache() instead
      */
+    @Deprecated
     public FontCache getFontCache() {
         return getFontManager().getFontCache();
     }
@@ -793,20 +800,13 @@ public class FopFactory implements Image
     }
 
     /**
-     * Create (if needed) and return an ICC ColorSpace instance.
-     *
-     * The ICC profile source is taken from the src attribute of the color-profile FO element.
-     * If the ICC ColorSpace is not yet in the cache a new one is created and stored in the cache.
-     *
-     * The FOP URI resolver is used to try and locate the ICC file.
-     * If that fails null is returned.
-     *
-     * @param baseUri a base URI to resolve relative URIs
-     * @param iccProfileSrc ICC Profile source to return a ColorSpace for
-     * @return ICC ColorSpace object or null if ColorSpace could not be created
+     * Returns the color space cache for this instance.
+     * <p>
+     * Note: this method should not be considered as part of FOP's external API.
+     * @return the color space cache
      */
-    public ColorSpace getColorSpace(String baseUri, String iccProfileSrc) {
-        return colorSpaceCache.get(baseUri, iccProfileSrc);
+    public ColorSpaceCache getColorSpaceCache() {
+        return this.colorSpaceCache;
     }
 
 }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeHandler.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeHandler.java Fri Feb 11 11:59:32 2011
@@ -201,14 +201,20 @@ public class AreaTreeHandler extends FOE
 
     private void startAbstractPageSequence(AbstractPageSequence pageSequence) {
         rootFObj = pageSequence.getRoot();
+
+        //Before the first page-sequence...
+        if (this.prevPageSeqLM == null) {
+            // extension attachments from fo:root
+            wrapAndAddExtensionAttachments(rootFObj.getExtensionAttachments());
+            // extension attachments from fo:declarations
+            if (rootFObj.getDeclarations() != null) {
+                wrapAndAddExtensionAttachments(
+                        rootFObj.getDeclarations().getExtensionAttachments());
+            }
+        }
+
         finishPrevPageSequence(pageSequence.getInitialPageNumber());
         pageSequence.initPageNumber();
-        // extension attachments from fo:root
-        wrapAndAddExtensionAttachments(rootFObj.getExtensionAttachments());
-        // extension attachments from fo:declarations
-        if (rootFObj.getDeclarations() != null) {
-            wrapAndAddExtensionAttachments(rootFObj.getDeclarations().getExtensionAttachments());
-        }
     }
 
     private void wrapAndAddExtensionAttachments(List<ExtensionAttachment> list) {
@@ -367,6 +373,7 @@ public class AreaTreeHandler extends FOE
      * @param pv a page viewport that contains the area with this ID
      * @deprecated use getIDTracker().associateIDWithPageViewport(id, pv) instead
      */
+    @Deprecated
     public void associateIDWithPageViewport(String id, PageViewport pv) {
         idTracker.associateIDWithPageViewport(id, pv);
     }
@@ -379,6 +386,7 @@ public class AreaTreeHandler extends FOE
      * @param id the id of the object being processed
      * @deprecated use getIDTracker().signalPendingID(id) instead
      */
+    @Deprecated
     public void signalPendingID(String id) {
         idTracker.signalPendingID(id);
     }
@@ -391,6 +399,7 @@ public class AreaTreeHandler extends FOE
      * @param id the id of the formatting object which was just finished
      * @deprecated use getIDTracker().signalIDProcessed(id) instead
      */
+    @Deprecated
     public void signalIDProcessed(String id) {
         idTracker.signalIDProcessed(id);
     }
@@ -402,6 +411,7 @@ public class AreaTreeHandler extends FOE
      * @return true if the ID has been resolved
      * @deprecated use getIDTracker().alreadyResolvedID(id) instead
      */
+    @Deprecated
     public boolean alreadyResolvedID(String id) {
         return idTracker.alreadyResolvedID(id);
     }
@@ -412,6 +422,7 @@ public class AreaTreeHandler extends FOE
      * @param pv page viewport whose ID refs to resolve
      * @deprecated use getIDTracker().tryIDResolution(pv) instead
      */
+    @Deprecated
     public void tryIDResolution(PageViewport pv) {
         idTracker.tryIDResolution(pv);
     }
@@ -423,6 +434,7 @@ public class AreaTreeHandler extends FOE
      * @return the list of PageViewports
      * @deprecated use getIDTracker().getPageViewportsContainingID(id) instead
      */
+    @Deprecated
     public List<PageViewport> getPageViewportsContainingID(String id) {
         return idTracker.getPageViewportsContainingID(id);
     }
@@ -434,6 +446,7 @@ public class AreaTreeHandler extends FOE
      * @param res the Resolvable object needing the idref to be resolved
      * @deprecated use getIDTracker().addUnresolvedIDRef(idref, res) instead
      */
+    @Deprecated
     public void addUnresolvedIDRef(String idref, Resolvable res) {
         idTracker.addUnresolvedIDRef(idref, res);
     }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/Constants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/Constants.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/Constants.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/Constants.java Fri Feb 11 11:59:32 2011
@@ -778,9 +778,11 @@ public interface Constants {
      * Used for accessibility.
      */
     int PR_X_ALT_TEXT = 275;
+    /** Property constant - FOP proprietary prototype (in XSL-FO 2.0 Requirements) */
+    int PR_X_XML_BASE = 276;
 
     /** Number of property constants defined */
-    int PROPERTY_COUNT = 275;
+    int PROPERTY_COUNT = 276;
 
     // compound property constants
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOPropertyMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOPropertyMapping.java Fri Feb 11 11:59:32 2011
@@ -62,8 +62,9 @@ import org.apache.fop.fo.properties.Spac
 import org.apache.fop.fo.properties.SpacingPropertyMaker;
 import org.apache.fop.fo.properties.StringProperty;
 import org.apache.fop.fo.properties.TableBorderPrecedence;
-import org.apache.fop.fo.properties.TextDecorationProperty;
+import org.apache.fop.fo.properties.TextDecorationMaker;
 import org.apache.fop.fo.properties.ToBeImplementedProperty;
+import org.apache.fop.fo.properties.URIProperty;
 import org.apache.fop.fo.properties.VerticalAlignShorthandParser;
 import org.apache.fop.fo.properties.WhiteSpaceShorthandParser;
 import org.apache.fop.fo.properties.XMLLangShorthandParser;
@@ -1696,7 +1697,7 @@ public final class FOPropertyMapping imp
 
         // text-decoration
         //m  = new EnumProperty.Maker(PR_TEXT_DECORATION);
-        m  = new TextDecorationProperty.Maker(PR_TEXT_DECORATION);
+        m  = new TextDecorationMaker(PR_TEXT_DECORATION);
         m.setInherited(false);
         m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
         m.addEnum("underline", getEnumProperty(EN_UNDERLINE, "UNDERLINE"));
@@ -2575,7 +2576,7 @@ public final class FOPropertyMapping imp
         addPropertyMaker("score-spaces", m);
 
         // src
-        m  = new StringProperty.Maker(PR_SRC);
+        m  = new URIProperty.Maker(PR_SRC);
         m.setInherited(false);
         m.setDefault("");
         addPropertyMaker("src", m);
@@ -2822,6 +2823,12 @@ public final class FOPropertyMapping imp
         m.setDatatypeParser(new XMLLangShorthandParser());
         addPropertyMaker("xml:lang", m);
 
+        // xml:base
+        m  = new URIProperty.Maker(PR_X_XML_BASE);
+        m.setInherited(true);
+        m.setDefault("");
+        addPropertyMaker("xml:base", m);
+
        }
 
 }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOValidationEventProducer.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOValidationEventProducer.xml?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOValidationEventProducer.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOValidationEventProducer.xml Fri Feb 11 11:59:32 2011
@@ -9,6 +9,7 @@
   <message key="rule.childOfSPM">The element must be a child of fo:simple-page-master.</message>
   <message key="rule.childOfDeclarations">The element must be a child of fo:declarations.</message>
   <message key="rule.childOfSPMorDeclarations">The element must be a child of fo:declarations or fo:simple-page-master.</message>
+  <message key="rule.childOfSPMorPSorDeclarations">The element must be a child of fo:declarations, fo:simple-page-master or fo:page-sequence.</message>
   <message key="rule.childOfInstreamForeignObjectorExternalGraphic">The element must be a child of fo:instream-foreign-object or fo:external-graphic.</message>
   <message key="rule.childOfPageSequence">The element must be a child of fo:page-sequence.</message>
   <message key="rule.childOfPageSequenceOrSPM">The element must be a child of fo:page-sequence or fo:simple-page-master.</message>

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/PropertyList.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/PropertyList.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/PropertyList.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/PropertyList.java Fri Feb 11 11:59:32 2011
@@ -317,7 +317,8 @@ public abstract class PropertyList {
             attributeName = attributes.getQName(i);
             attributeValue = attributes.getValue(i);
             if (attributeNS == null || attributeNS.length() == 0
-                    || "xml:lang".equals(attributeName)) {
+                    || "xml:lang".equals(attributeName)
+                    || "xml:base".equals(attributeName)) {
                 convertAttributeToProperty(attributes, attributeName, attributeValue);
             } else if (!factory.isNamespaceIgnored(attributeNS)) {
                 ElementMapping mapping = factory.getElementMappingRegistry().getElementMapping(

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyParser.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyParser.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyParser.java Fri Feb 11 11:59:32 2011
@@ -69,6 +69,8 @@ public final class PropertyParser extend
         FUNCTION_TABLE.put("label-end", new LabelEndFunction());
         FUNCTION_TABLE.put("body-start", new BodyStartFunction());
         FUNCTION_TABLE.put("rgb-icc", new ICCColorFunction());
+        FUNCTION_TABLE.put("rgb-named-color", new NamedColorFunction()); //since XSL-FO 2.0
+        FUNCTION_TABLE.put("cie-lab-color", new CIELabColorFunction()); //since XSL-FO 2.0
         FUNCTION_TABLE.put("cmyk", new CMYKcolorFunction()); //non-standard!!!
 
         /**

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java Fri Feb 11 11:59:32 2011
@@ -80,7 +80,6 @@ class PropertyTokenizer {
     void next() throws PropertyException {
         currentTokenValue = null;
         currentTokenStartIndex = exprIndex;
-        boolean currentMaybeOperator = recognizeOperator;
         boolean bSawDecimal;
         recognizeOperator = true;
         while ( true ) {
@@ -244,14 +243,14 @@ class PropertyTokenizer {
 
 
     private void nextColor() throws PropertyException {
-        if (exprIndex < exprLength
-                && isHexDigit(expr.charAt(exprIndex))) {
+        if (exprIndex < exprLength) {
             ++exprIndex;
             scanHexDigits();
             int len = exprIndex - currentTokenStartIndex - 1;
             if (len % 3 == 0) {
                 currentToken = TOK_COLORSPEC;
             } else {
+                //Actually not a color at all, but an NCNAME starting with "#"
                 scanRestOfName();
                 currentToken = TOK_NCNAME;
             }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ColorProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ColorProperty.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ColorProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ColorProperty.java Fri Feb 11 11:59:32 2011
@@ -70,6 +70,7 @@ public final class ColorProperty extends
          * @throws PropertyException
          *             for invalid or inconsistent FO input
          */
+        @Override
         public Property convertProperty(Property p,
                                         PropertyList propertyList, FObj fo)
                     throws PropertyException {
@@ -120,11 +121,13 @@ public final class ColorProperty extends
      * @param foUserAgent FOP user agent
      * @return float the AWT color represented by this ColorType instance
      */
+    @Override
     public Color getColor(FOUserAgent foUserAgent) {
         return color;
     }
 
     /** {@inheritDoc} */
+    @Override
     public String toString() {
         return ColorUtil.colorToString(color);
     }
@@ -140,23 +143,27 @@ public final class ColorProperty extends
     /**
      * @return this.colorType cast as an Object
      */
+    @Override
     public Object getObject() {
         return this;
     }
 
     /** {@inheritDoc} */
+    @Override
     public boolean equals(Object o) {
         if (this == o) {
             return true;
         }
 
         if (o instanceof ColorProperty) {
-            return ((ColorProperty) o).color.equals(this.color);
+            return org.apache.xmlgraphics.java2d.color.ColorUtil.isSameColor(
+                    ((ColorProperty) o).color, this.color);
         }
         return false;
     }
 
     /** {@inheritDoc} */
+    @Override
     public int hashCode() {
         return this.color.hashCode();
     }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ListProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ListProperty.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ListProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/ListProperty.java Fri Feb 11 11:59:32 2011
@@ -23,6 +23,7 @@ import java.util.List;
 
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Superclass for properties that are lists of other properties
@@ -30,22 +31,23 @@ import org.apache.fop.fo.PropertyList;
 public class ListProperty extends Property {
 
     /**
-     * Inner class for creating instances of ListProperty
+     * Inner class for creating instances of {@code ListProperty}
      */
     public static class Maker extends PropertyMaker {
 
         /**
+         * Create a maker for the given property id.
          * @param propId ID of the property for which Maker should be created
          */
         public Maker(int propId) {
             super(propId);
         }
 
-        /**
-         * {@inheritDoc}
-         */
+        /** {@inheritDoc} */
+        @Override
         public Property convertProperty(Property p,
-                                        PropertyList propertyList, FObj fo) {
+                                        PropertyList propertyList, FObj fo)
+                        throws PropertyException {
             if (p instanceof ListProperty) {
                 return p;
             } else {
@@ -56,7 +58,7 @@ public class ListProperty extends Proper
     }
 
     /** Vector containing the list of sub-properties */
-    protected List list = new java.util.Vector();
+    protected final List<Property> list = new java.util.Vector<Property>();
 
     /**
      * Simple constructor used by subclasses to do some special processing.
@@ -66,7 +68,9 @@ public class ListProperty extends Proper
     }
 
     /**
-     * @param prop the first Property to be added to the list
+     * Create a new instance, using the given {@link Property} as the first
+     * element in the list.
+     * @param prop the first property to be added to the list
      */
     public ListProperty(Property prop) {
         this();
@@ -82,15 +86,21 @@ public class ListProperty extends Proper
     }
 
     /**
-     * @return this.list
+     * Return the {@code java.util.List} of {@link Property} instances
+     * contained in this property.
+     * @return the list of properties contained in this instance
      */
-    public List getList() {
+    @Override
+    public List<Property> getList() {
         return list;
     }
 
     /**
+     * Return the {@code java.util.List} of {@link Property} instances,
+     * cast as a {@code java.lang.Object}.
      * @return this.list cast as an Object
      */
+    @Override
     public Object getObject() {
         return list;
     }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java Fri Feb 11 11:59:32 2011
@@ -29,6 +29,8 @@ import java.util.TreeSet;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import org.apache.xmlgraphics.fonts.Glyphs;
+
 /**
  * Generic SingleByte font
  */
@@ -44,6 +46,7 @@ public class SingleByteFont extends Cust
 
     private Map<Character, UnencodedCharacter> unencodedCharacters;
     private List<SimpleSingleByteEncoding> additionalEncodings;
+    private Map<Character, Character> alternativeCodes;
 
 
     /**
@@ -99,19 +102,69 @@ public class SingleByteFont extends Cust
         return arr;
     }
 
-    /** {@inheritDoc} */
-    @Override
-    public char mapChar(char c) {
-        notifyMapOperation();
+    /**
+     * Lookup a character using its alternative names. If found, cache it so we
+     * can speed up lookups.
+     * @param c the character
+     * @return the suggested alternative character present in the font
+     */
+    private char findAlternative(char c) {
+        char d;
+        if (alternativeCodes == null) {
+            alternativeCodes = new java.util.HashMap<Character, Character>();
+        } else {
+            Character alternative = alternativeCodes.get(c);
+            if (alternative != null) {
+                return alternative;
+            }
+        }
+        String charName = Glyphs.charToGlyphName(c);
+        String[] charNameAlternatives = Glyphs.getCharNameAlternativesFor(charName);
+        if (charNameAlternatives != null && charNameAlternatives.length > 0) {
+            for (int i = 0; i < charNameAlternatives.length; i++) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Checking alternative for char " + c + " (charname="
+                            + charName + "): " + charNameAlternatives[i]);
+                }
+                String s = Glyphs.getUnicodeSequenceForGlyphName(charNameAlternatives[i]);
+                if (s != null) {
+                    d = lookupChar(s.charAt(0));
+                    if (d != SingleByteEncoding.NOT_FOUND_CODE_POINT) {
+                        alternativeCodes.put(c, d);
+                        return d;
+                    }
+                }
+            }
+        }
+
+        return SingleByteEncoding.NOT_FOUND_CODE_POINT;
+    }
+
+    private char lookupChar(char c) {
         char d = mapping.mapChar(c);
         if (d != SingleByteEncoding.NOT_FOUND_CODE_POINT) {
             return d;
         }
 
-        //Check unencoded characters which are available in the font by character name
+        // Check unencoded characters which are available in the font by
+        // character name
         d = mapUnencodedChar(c);
+        return d;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public char mapChar(char c) {
+        notifyMapOperation();
+        char d = lookupChar(c);
         if (d != SingleByteEncoding.NOT_FOUND_CODE_POINT) {
             return d;
+        } else {
+            // Check for alternative
+            d = findAlternative(c);
+            if (d != SingleByteEncoding.NOT_FOUND_CODE_POINT) {
+                return d;
+            }
         }
         this.warnMissingGlyph(c);
         return Typeface.NOT_FOUND;
@@ -162,6 +215,11 @@ public class SingleByteFont extends Cust
         if (d != SingleByteEncoding.NOT_FOUND_CODE_POINT) {
             return true;
         }
+        // Check if an alternative exists
+        d = findAlternative(c);
+        if (d != SingleByteEncoding.NOT_FOUND_CODE_POINT) {
+            return true;
+        }
         return false;
     }
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Fri Feb 11 11:59:32 2011
@@ -20,7 +20,6 @@
 package org.apache.fop.layoutmgr;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Map;
@@ -34,27 +33,27 @@ import org.apache.fop.area.PageViewport;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.flow.Marker;
 import org.apache.fop.fo.flow.RetrieveMarker;
+import org.apache.xmlgraphics.util.QName;
 
 /**
  * The base class for most LayoutManagers.
  */
 public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
-    implements Constants {
+        implements Constants {
 
-    /**
-     * logging instance
-     */
+    /** logging instance */
     private static Log log = LogFactory.getLog(AbstractLayoutManager.class);
 
     /** Parent LayoutManager for this LayoutManager */
     protected LayoutManager parentLayoutManager;
     /** List of child LayoutManagers */
-    protected List childLMs;
+    protected List<LayoutManager> childLMs;
     /** Iterator for child LayoutManagers */
     protected ListIterator fobjIter;
     /** Marker map for markers related to this LayoutManager */
-    private Map markers;
+    private Map<String, Marker> markers;
 
     /** True if this LayoutManager has handled all of its content. */
     private boolean isFinished;
@@ -63,7 +62,7 @@ public abstract class AbstractLayoutMana
     protected LayoutManager curChildLM;
 
     /** child LM iterator during getNextKnuthElement phase */
-    protected ListIterator childLMiter;
+    protected ListIterator<LayoutManager> childLMiter;
 
     private int lastGeneratedPosition = -1;
     private int smallestPosNumberChecked = Integer.MAX_VALUE;
@@ -116,7 +115,7 @@ public abstract class AbstractLayoutMana
             return curChildLM;
         }
         if (childLMiter.hasNext()) {
-            curChildLM = (LayoutManager) childLMiter.next();
+            curChildLM = childLMiter.next();
             curChildLM.initialize();
             return curChildLM;
         }
@@ -131,7 +130,7 @@ public abstract class AbstractLayoutMana
         curChildLM = childLM;
         childLMiter = new LMiter(this);
         do {
-            curChildLM = (LayoutManager) childLMiter.next();
+            curChildLM = childLMiter.next();
         } while (curChildLM != childLM);
     }
 
@@ -165,16 +164,14 @@ public abstract class AbstractLayoutMana
     }
 
     /** {@inheritDoc} */
-    public List getNextKnuthElements(LayoutContext context,
-                                           int alignment) {
+    public List getNextKnuthElements(LayoutContext context, int alignment) {
         log.warn("null implementation of getNextKnuthElements() called!");
         setFinished(true);
         return null;
     }
 
     /** {@inheritDoc} */
-    public List getChangedKnuthElements(List oldList,
-                                              int alignment) {
+    public List getChangedKnuthElements(List oldList, int alignment) {
         log.warn("null implementation of getChangeKnuthElement() called!");
         return null;
     }
@@ -210,11 +207,11 @@ public abstract class AbstractLayoutMana
      * @param size the requested number of child LMs
      * @return the list with the preloaded child LMs
      */
-    protected List createChildLMs(int size) {
+    protected List<LayoutManager> createChildLMs(int size) {
         if (fobjIter == null) {
             return null;
         }
-        List newLMs = new ArrayList(size);
+        List<LayoutManager> newLMs = new ArrayList<LayoutManager>(size);
         while (fobjIter.hasNext() && newLMs.size() < size ) {
             Object theobj = fobjIter.next();
             if (theobj instanceof FONode) {
@@ -250,35 +247,29 @@ public abstract class AbstractLayoutMana
         return getPSLM().getCurrentPage().getPageViewport();
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public boolean createNextChildLMs(int pos) {
-        List newLMs = createChildLMs(pos + 1 - childLMs.size());
+        List<LayoutManager> newLMs = createChildLMs(pos + 1 - childLMs.size());
         addChildLMs(newLMs);
         return pos < childLMs.size();
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    public List getChildLMs() {
+    /** {@inheritDoc} */
+    public List<LayoutManager> getChildLMs() {
         if (childLMs == null) {
-            childLMs = new java.util.ArrayList(10);
+            childLMs = new java.util.ArrayList<LayoutManager>(10);
         }
         return childLMs;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public void addChildLM(LayoutManager lm) {
         if (lm == null) {
             return;
         }
         lm.setParent(this);
         if (childLMs == null) {
-            childLMs = new java.util.ArrayList(10);
+            childLMs = new java.util.ArrayList<LayoutManager>(10);
         }
         childLMs.add(lm);
         if (log.isTraceEnabled()) {
@@ -287,17 +278,14 @@ public abstract class AbstractLayoutMana
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public void addChildLMs(List newLMs) {
         if (newLMs == null || newLMs.size() == 0) {
             return;
         }
-        ListIterator iter = newLMs.listIterator();
+        ListIterator<LayoutManager> iter = newLMs.listIterator();
         while (iter.hasNext()) {
-            LayoutManager lm = (LayoutManager) iter.next();
-            addChildLM(lm);
+            addChildLM(iter.next());
         }
     }
 
@@ -312,8 +300,7 @@ public abstract class AbstractLayoutMana
             throw new IllegalStateException("Position already got its index");
         }
 
-        lastGeneratedPosition++;
-        pos.setIndex(lastGeneratedPosition);
+        pos.setIndex(++lastGeneratedPosition);
         return pos;
     }
 
@@ -358,7 +345,7 @@ public abstract class AbstractLayoutMana
      * @param targetArea the area to set the attributes on
      */
     protected void transferForeignAttributes(AreaTreeObject targetArea) {
-        Map atts = fobj.getForeignAttributes();
+        Map<QName, String> atts = fobj.getForeignAttributes();
         targetArea.setForeignAttributes(atts);
     }
 
@@ -459,18 +446,20 @@ public abstract class AbstractLayoutMana
     }
 
     /** {@inheritDoc} */
+    @Override
     public String toString() {
         return (super.toString() + (fobj != null ? "{fobj = " + fobj.toString() + "}" : ""));
     }
 
     /** {@inheritDoc} */
+    @Override
     public void reset() {
         isFinished = false;
         curChildLM = null;
         childLMiter = new LMiter(this);
         /* Reset all the children LM that have been created so far. */
-        for (Iterator iter = getChildLMs().iterator(); iter.hasNext();) {
-            ((LayoutManager) iter.next()).reset();
+        for (LayoutManager childLM : getChildLMs()) {
+            childLM.reset();
         }
         if (fobj != null) {
             markers = fobj.getMarkers();

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java?rev=1069764&r1=1069763&r2=1069764&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java Fri Feb 11 11:59:32 2011
@@ -19,7 +19,6 @@
 
 package org.apache.fop.layoutmgr;
 
-import java.util.Iterator;
 import java.util.LinkedList;
 
 import org.apache.fop.layoutmgr.SpaceResolver.SpaceHandlingBreakPosition;
@@ -32,20 +31,6 @@ public final class AreaAdditionUtil {
     private AreaAdditionUtil() {
     }
 
-    private static class StackingIter extends PositionIterator {
-        StackingIter(Iterator parentIter) {
-            super(parentIter);
-        }
-
-        protected LayoutManager getLM(Object nextObj) {
-            return ((Position) nextObj).getLM();
-        }
-
-        protected Position getPos(Object nextObj) {
-            return ((Position) nextObj);
-        }
-    }
-
     /**
      * Creates the child areas for the given layout manager.
      * @param bslm the BlockStackingLayoutManager instance for which "addAreas" is performed.
@@ -54,19 +39,23 @@ public final class AreaAdditionUtil {
      */
     public static void addAreas(BlockStackingLayoutManager bslm,
             PositionIterator parentIter, LayoutContext layoutContext) {
-        LayoutManager childLM = null;
+        LayoutManager childLM;
         LayoutContext lc = new LayoutContext(0);
         LayoutManager firstLM = null;
         LayoutManager lastLM = null;
         Position firstPos = null;
         Position lastPos = null;
 
+        if (bslm != null) {
+            bslm.addId();
+        }
+        
         // "unwrap" the NonLeafPositions stored in parentIter
         // and put them in a new list;
-        LinkedList positionList = new LinkedList();
+        LinkedList<Position> positionList = new LinkedList<Position>();
         Position pos;
         while (parentIter.hasNext()) {
-            pos = (Position)parentIter.next();
+            pos = parentIter.next();
             if (pos == null) {
                 continue;
             }
@@ -78,8 +67,8 @@ public final class AreaAdditionUtil {
             }
             if (pos instanceof NonLeafPosition) {
                 // pos was created by a child of this FlowLM
-                positionList.add(((NonLeafPosition) pos).getPosition());
-                lastLM = ((NonLeafPosition) pos).getPosition().getLM();
+                positionList.add(pos.getPosition());
+                lastLM = (pos.getPosition().getLM());
                 if (firstLM == null) {
                     firstLM = lastLM;
                 }
@@ -104,7 +93,7 @@ public final class AreaAdditionUtil {
                     bslm.isLast(lastPos));
         }
 
-        StackingIter childPosIter = new StackingIter(positionList.listIterator());
+        PositionIterator childPosIter = new PositionIterator(positionList.listIterator());
 
         while ((childLM = childPosIter.getNextChildLM()) != null) {
             // TODO vh: the test above might be problematic in some cases. See comment in
@@ -129,6 +118,7 @@ public final class AreaAdditionUtil {
                     false,
                     bslm.isFirst(firstPos),
                     bslm.isLast(lastPos));
+            bslm.checkEndOfLayout(lastPos);
         }
 
 



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