From fop-commits-return-8778henryheather@example.com Sun Jul 01 12:11:21 2007 Return-Path: <fop-commits-return-8778henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 61687 invoked from network); 1 Jul 2007 12:11:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jul 2007 12:11:20 -0000 Received: (qmail 26418 invoked by uid 500); 1 Jul 2007 12:11:23 -0000 Delivered-To: henryheather@example.com Received: (qmail 26325 invoked by uid 500); 1 Jul 2007 12:11:23 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 26312 invoked by uid 99); 1 Jul 2007 12:11:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2007 05:11:23 -0700 X-ASF-Spam-Status: No, hits=-99.7 required=10.0 tests=ALL_TRUSTED,NO_OBLIGATION X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eos.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2007 05:11:19 -0700 Received: from eos.apache.org (localhost [83.161.120.155]) by eos.apache.org (Postfix) with ESMTP id C064959A07 for <henryheather@example.com>; Sun, 1 Jul 2007 12:10:58 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki <henryheather@example.com> To: henryheather@example.com Date: Sun, 01 Jul 2007 12:10:58 -0000 Message-ID: <henryheather@example.com> Subject: [Xmlgraphics-fop Wiki] Update of "PropertyHandling" by AndreasDelmelle X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification. The following page has been changed by AndreasDelmelle: http://wiki.apache.org/xmlgraphics-fop/PropertyHandling ------------------------------------------------------------------------------ == General Info == - FOP's property subsystem is a component that is easily misunderstood. org.apache.fop.fo.properties.Property and its derived classes do not exactly correspond to FO properties, but rather, different ''types'' of FO properties. The mapping of a FO property name to a Property subclass is defined in org.apache.fop.fo.FO!PropertyMapping, a class that seems a bit intimidating at first glance... + FOP's property subsystem is a component that is easily misunderstood. {{{org.apache.fop.fo.properties.Property}}} and its derived classes do not exactly correspond to FO properties, but rather, different ''types'' of FO properties. The mapping of a FO property name to a Property subclass is defined in {{{org.apache.fop.fo.FOPropertyMapping}}}, a class that seems a bit intimidating at first glance... == FOPropertyMapping == - While the source file seems immense, all the code in there is only executed once for multiple FOP runs within the same virtual machine. What it gets to contain after this code has been executed, is a mapping of FO property names to one of the org.apache.fop.fo.properties.!PropertyMaker subclasses. Those !PropertyMakers have been customized to fit the behavior as mandated by or prescribed in the XSL-FO Recommendation for a given property, such as: + While the source file seems immense, all the code in there is only executed once for multiple FOP runs within the same virtual machine. What it gets to contain after this code has been executed, is a mapping of FO property names to one of the {{{org.apache.fop.fo.properties.PropertyMaker}}} subclasses. Those {{{PropertyMakers}}} have been customized to fit the behavior as mandated by or prescribed in the XSL-FO Recommendation for a given property, such as: - * which enums and/or value keywords are allowed as values: addEnum() and addKeyword() + * which enums and/or value keywords are allowed as values: {{{addEnum()}}} and {{{addKeyword()}}} - * which shorthands can set the property: addShorthand() + * which shorthands can set the property: {{{addShorthand()}}} - * for shorthands, which custom parser to use: setDatatypeParser() + * for shorthands, which custom parser to use: {{{setDatatypeParser()}}} - * which corresponding properties can set the property: setCorresponding() + * which corresponding properties can set the property: {{{setCorresponding()}}} - * whether a property is inherited or not: setInherited() + * whether a property is inherited or not: {{{setInherited()}}} - * the default value: setDefault() + * the default value: {{{setDefault()}}} - The customized !PropertyMakers in FO!PropertyMapping are used when the tree of FOs is built from the XML events coming in from the SAX Parser. + The customized {{{PropertyMakers}}} in {{{FOPropertyMapping}}} are used when the tree of FOs is built from the XML events coming in from the SAX Parser. - In org.apache.fop.fo.FO!TreeBuilder.MainFOHandler.startElement() the current node's list of attributes is given to an instance of org.apache.fop.fo.!PropertyList, which uses the attribute names and FO!PropertyMapping to get to the right !PropertyMakers to convert each of the attribute values to the appropriate FOP-internal Property type. + In {{{org.apache.fop.fo.FOTreeBuilder.MainFOHandler.startElement()}}} the current node's list of attributes is given to an instance of {{{org.apache.fop.fo.PropertyList}}}, which uses the attribute names and {{{FOPropertyMapping}}} to get to the right {{{PropertyMakers}}} to convert each of the attribute values to the appropriate FOP-internal {{{Property}}} type. == The PropertyMakers == - There are two distinct points where !PropertyMakers are used: + There are two distinct points in the overall process where {{{PropertyMakers}}} are used: - * when an explicitly specified attribute value is converted to a Property: in the most basic case this is a call to !PropertyMaker.make(!PropertyList, String, FObj), a method that can be overridden by subclasses to cater for custom property parsing if the generic org.apache.fop.fo.expr.!PropertyParser does not suffice (see for example org.apache.fop.fo.properties.!FontFamilyProperty.Maker, which bypasses the generic space-based list parsing). + * when an explicitly specified attribute value is converted to a {{{Property}}} + * when binding a {{{PropertyList}}} to a FO - * when binding a !PropertyList to a FO: - * to supply initial values for a property that is applicable but was not specified + === Conversion of explicitly specified FO properties === + This is initiated in {{{PropertyList.convertAttributeToProperty()}}}, and in the most basic case comes down to a call to {{{PropertyMaker.make(PropertyList,String,FObj)}}}. The default implementation of this method provides for the following: + 1. resolving explicit inheritance (specified value of {{{"inherit"}}}) + 1. substitution of value keywords ({{{checkValueKeywords()}}}) + 1. checking valid enum values ({{{checkEnumValues()}}}) + 1. parsing the expression ({{{PropertyParser.parse()}}}), if the above did not yet yield a {{{Property}}} + 1. converting the resulting {{{Property}}}, if any, to the right type ({{{convertProperty()}}}) + + This method can be overridden by subclasses, for example to cater for custom property parsing if the generic {{{org.apache.fop.fo.expr.PropertyParser}}} does not suffice (see {{{org.apache.fop.fo.properties.FontFamilyProperty.Maker}}}, which bypasses the generic space-based expression parsing). + + === Binding a FOP PropertyList to an FObj === + This is done in {{{org.apache.fop.fo.FObj.bind()}}}, and results in an {{{FObj}}} being tied to the set of applicable properties, so that the {{{PropertyList}}} (which reserves space for all ''possible'' properties) is no longer needed. In case of the explicitly specified properties, the {{{PropertyMaker}}}'s role here is limited to ''finding'' the {{{Property}}} on the {{{PropertyList}}} and simply returning it unaltered. What the {{{PropertyMaker}}}s ''are'' mostly used for in this part of the process is: - * to get to a native XSL-FO property that was explicitly set by a CSS shorthand (e.g. border-before-width and border); ideally, only the native XSL-FO properties are bound to the FOs + * to get to a native XSL-FO property that was explicitly set by a CSS shorthand (e.g. {{{border-before-width}}} and {{{border}}}); ideally, only the native XSL-FO properties are bound to the FOs - * to get to the ''relative'' property from an ''absolute'' one (e.g. space-before and margin-top) + * to get to the ''relative'' property from an ''absolute'' one (e.g. {{{space-before}}} and {{{margin-top}}}) + * to supply initial values for a property that is applicable but was not specified: {{{PropertyMaker.findProperty(PropertyList, boolean)}}} will return {{{null}}}, and {{{PropertyMaker.make(PropertyList)}}} will be called, returning the initial value. == What about those PropertyLists? == - !PropertyLists are relatively short-lived in most cases. The !PropertyList for the first fo:block in an fo:flow is released before the one for its sibling fo:block is created; only a reference to the parent is maintained (see FO!TreeBuilder.MainFOHandler.endElement(): the current!PropertyList is set back to that of the parent FO, so the one for the processed node goes out of scope). The only notable exception is the !PropertyList-ancestry of fo:retrieve-markers: that is preserved until layout, to be able to correctly deal with markers and property inheritance. The !PropertyList subclass used for the attributes of descendants of an fo:marker themselves is actually a hybrid of !PropertyList and SAX Attributes. It only stores simple name-value mappings and implements the Attributes interface so it can itself be used to create a full-fledged !StaticPropertyList later on, when the marker is retrieved. + {{{PropertyList}}}s are large, but relatively short-lived in most cases. The {{{PropertyList}}} for the first fo:block in an fo:flow is released before the one for its sibling fo:block is created; only a reference to the parent is maintained (see {{{FOTreeBuilder.MainFOHandler.endElement()}}}: the {{{currentPropertyList}}} is set back to that of the parent FO, so the one for the processed node goes out of scope). The only notable exception is the {{{PropertyList}}}-ancestry of fo:retrieve-markers: that is preserved until layout, to be able to correctly deal with markers and property inheritance. The {{{MarkerPropertyList}}} subclass used for the attributes of descendants of an fo:marker themselves is actually a hybrid of {{{PropertyList}}} and SAX {{{Attributes}}}. It only stores simple name-value mappings and implements the {{{Attributes}}} interface so it can itself be used to create a full-fledged {{{StaticPropertyList}}} later on, when the marker is retrieved. - (Note that a simple reference to the original Attributes does not suffice here, since the SAX parser is under no obligation to keep it available after the parent element's endElement() has passed, which is long before the point where they would needed.) + (Note that a simple reference to the original {{{Attributes}}} does not suffice here, since the SAX parser is under no obligation to keep it available after the parent element's endElement() has passed, which is long before the point where they would needed.) - !PropertyLists are primarily important for resolving inheritance, triggering shorthand expansion and computing properties from corresponding properties. They are designed to be a bridge between the FOs and the !PropertyMakers. The !PropertyList is constructed separately from the FO, and first filled with the explicitly specified properties. In the bind() method, each org.apache.fop.fo.FObj subclass issues get(PR_XX)-requests for all applicable (and implemented) properties to the !PropertyList, which in turn can trigger additional !PropertyMakers' get()-calls. + {{{PropertyList}}}s are primarily important for: + a. resolving inheritance + a. triggering shorthand expansion + a. computing properties from corresponding properties - * Inheritance is handled entirely by the !PropertyList, and comes down to forwarding the get(PR_XX)-call to the parent!PropertyList. + They are designed to be a bridge between the {{{FObj}}}s and the {{{PropertyMaker}}}s. The {{{PropertyList}}} is constructed separately from the FO, and first filled with the explicitly specified properties. In the {{{bind()}}} method, each {{{org.apache.fop.fo.FObj}}} subclass issues {{{get(PR_XX)}}}-requests for all applicable (and implemented) properties to the {{{PropertyList}}}, which in turn can trigger additional {{{PropertyMaker}}}s' {{{get()}}}-calls. + + === Property Inheritance === + Inheritance is handled almost entirely by the {{{PropertyList}}}, and comes down to having the {{{PropertyMaker}}} check whether the property is inherited, and if so, have it forward the {{{get(PR_XX)}}}-call to the {{{parentPropertyList}}}. + + === Shorthand Expansion === - * Shorthand expansion involves the !PropertyMakers: if there is no explicitly specified value available and the !PropertyMaker was customized to allow the property to be set by a shorthand, the request is forwarded via the shorthand's !PropertyMaker to the defined !ShorthandParser implementation. As long as the FO has not requested the base properties, the shorthand is stored as a single Property instance whose associated !PropertyMaker instance contains a !ShorthandParser that is designed to serve get(PR_XX)-requests for the base properties. Once the bind() method has been executed, most of the shorthands themselves will only be referenced by (and thus, later on disappear together with) the !PropertyList. + If there is no explicitly specified value available and the {{{PropertyMaker}}} was customized to allow the property to be set by a shorthand, the request is forwarded via the shorthand's {{{PropertyMaker}}} to the defined {{{ShorthandParser}}} implementation. As long as the FO has not requested the base properties, the shorthand is stored as a single {{{Property}}} instance whose associated {{{PropertyMaker}}} instance contains a {{{ShorthandParser}}} that is designed to serve {{{get(PR_XX)}}}-requests for the base properties. Once the {{{bind()}}} method has been executed, most of the shorthands themselves will only be referenced by (and thus, later on disappear together with) the {{{PropertyList}}}. + + === Corresponding Property Computation === - * Corresponding property computation is performed analogously, by involving another !PropertyMaker that was associated to the base property's Maker in FO!PropertyMapping. + This is performed analogously, by involving another {{{PropertyMaker}}} that was associated to the base property's {{{Maker}}} in {{{FOPropertyMapping}}}. + == Implementing an additional FO property in FOP without implementing a Property? == - It's possible, if the Property's datatype is already supported, which will be the case for most types of property, like !NumberProperty, !StringProperty or !EnumProperty. + It's possible, if the property's datatype is already supported, which will be the case for most types of property, like {{{NumberProperty}}}, {{{StringProperty}}} or {{{EnumProperty}}}. - * Add a symbolic constant (PR_XX) to org.apache.fop.fo.Constants.java: this will be used in the code that retrieves the right !PropertyMaker for the new Property. For some unimplemented properties this will already be defined. For !EnumProperty, you may need additional constants (EN_XX) for the enum values as well. - * Register a customized !PropertyMaker for the property in org.apache.fop.fo.FO!PropertyMapping.java. Implement a new one if necessary. Check FO!PropertyMapping if there is no !ToBeImplementedProperty.Maker already in place. + * Add a symbolic constant ({{{PR_XX}}}) to {{{org.apache.fop.fo.Constants}}}: this will be used in the code that retrieves the right {{{PropertyMaker}}} for the new property. For some unimplemented properties this will already be defined. For an {{{EnumProperty}}}, you may need additional constants ({{{EN_XX}}}) for the enum values as well. + * Register a customized {{{PropertyMaker}}} for the property in {{{org.apache.fop.fo.FOPropertyMapping}}}. Implement a new one if necessary. Check {{{FOPropertyMapping}}} if there is a {{{ToBeImplementedProperty.Maker}}} already in place. - * Add an instance member to the applicable FOs, and bind it to the !PropertyList's Property which becomes available through the above two steps. Accessors on the FOs for the new Property will be needed too. + * Add an instance member to the applicable FOs, and bind it to the {{{PropertyList}}}'s Property which becomes available through the above two steps. Accessors on the FOs for the new property will be needed too. - * Add the necessary code to the corresponding !LayoutManagers, Areas and/or Renderers to do something with the newly available property + * Add the necessary code to the corresponding {{{LayoutManager}}}s, {{{Area}}}s and/or {{{Renderer}}}s to do something with the newly available property == Percentages == see ["PropertyHandling/Percentages"] --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8779henryheather@example.com Sun Jul 01 17:42:27 2007 Return-Path: <fop-commits-return-8779henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 14949 invoked from network); 1 Jul 2007 17:42:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jul 2007 17:42:27 -0000 Received: (qmail 55340 invoked by uid 500); 1 Jul 2007 17:42:30 -0000 Delivered-To: henryheather@example.com Received: (qmail 55236 invoked by uid 500); 1 Jul 2007 17:42:29 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 55223 invoked by uid 99); 1 Jul 2007 17:42:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2007 10:42:29 -0700 X-ASF-Spam-Status: No, hits=-99.7 required=10.0 tests=ALL_TRUSTED,NO_OBLIGATION X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eos.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2007 10:42:26 -0700 Received: from eos.apache.org (localhost [83.161.120.155]) by eos.apache.org (Postfix) with ESMTP id 0DA9859A07 for <henryheather@example.com>; Sun, 1 Jul 2007 17:42:05 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki <henryheather@example.com> To: henryheather@example.com Date: Sun, 01 Jul 2007 17:42:04 -0000 Message-ID: <henryheather@example.com> Subject: [Xmlgraphics-fop Wiki] Trivial Update of "PropertyHandling" by AndreasDelmelle X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification. The following page has been changed by AndreasDelmelle: http://wiki.apache.org/xmlgraphics-fop/PropertyHandling ------------------------------------------------------------------------------ == What about those PropertyLists? == {{{PropertyList}}}s are large, but relatively short-lived in most cases. The {{{PropertyList}}} for the first fo:block in an fo:flow is released before the one for its sibling fo:block is created; only a reference to the parent is maintained (see {{{FOTreeBuilder.MainFOHandler.endElement()}}}: the {{{currentPropertyList}}} is set back to that of the parent FO, so the one for the processed node goes out of scope). The only notable exception is the {{{PropertyList}}}-ancestry of fo:retrieve-markers: that is preserved until layout, to be able to correctly deal with markers and property inheritance. The {{{MarkerPropertyList}}} subclass used for the attributes of descendants of an fo:marker themselves is actually a hybrid of {{{PropertyList}}} and SAX {{{Attributes}}}. It only stores simple name-value mappings and implements the {{{Attributes}}} interface so it can itself be used to create a full-fledged {{{StaticPropertyList}}} later on, when the marker is retrieved. - (Note that a simple reference to the original {{{Attributes}}} does not suffice here, since the SAX parser is under no obligation to keep it available after the parent element's endElement() has passed, which is long before the point where they would needed.) + (Note that a simple reference to the original {{{Attributes}}} does not suffice here, since the SAX parser is under no obligation to keep it available after the parent element's endElement() has passed, which is long before the point where they would be needed.) {{{PropertyList}}}s are primarily important for: a. resolving inheritance --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8780henryheather@example.com Thu Jul 05 19:28:45 2007 Return-Path: <fop-commits-return-8780henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 36242 invoked from network); 5 Jul 2007 19:02:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Jul 2007 19:02:13 -0000 Received: (qmail 49301 invoked by uid 500); 5 Jul 2007 19:01:39 -0000 Delivered-To: henryheather@example.com Received: (qmail 49276 invoked by uid 500); 5 Jul 2007 19:01:39 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 49263 invoked by uid 99); 5 Jul 2007 19:01:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 12:01:39 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 12:01:35 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 8B96A1A981D; Thu, 5 Jul 2007 12:01:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553612 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java Date: Thu, 05 Jul 2007 19:01:15 -0000 To: henryheather@example.com From: henryheather@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <henryheather@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: adelmelle Date: Thu Jul 5 12:01:14 2007 New Revision: 553612 URL: http://svn.apache.org/viewvc?view=rev&rev=553612 Log: Fix for a tiny but very nasty bug... Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java?view=diff&rev=553612&r1=553611&r2=553612 ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java Thu Jul 5 12:01:14 2007 @@ -1054,39 +1054,39 @@ /** Enumeration constant */ int EN_LIGHTER = 168; /** Enumeration constant */ - int EN_100 = 168; + int EN_100 = 169; /** Enumeration constant */ - int EN_200 = 169; + int EN_200 = 170; /** Enumeration constant */ - int EN_300 = 170; + int EN_300 = 171; /** Enumeration constant */ - int EN_400 = 171; + int EN_400 = 172; /** Enumeration constant */ - int EN_500 = 172; + int EN_500 = 173; /** Enumeration constant */ - int EN_600 = 173; + int EN_600 = 174; /** Enumeration constant */ - int EN_700 = 174; + int EN_700 = 175; /** Enumeration constant */ - int EN_800 = 175; + int EN_800 = 176; /** Enumeration constant */ - int EN_900 = 176; + int EN_900 = 177; /** Enumeration constant -- page-break-shorthand */ - int EN_AVOID = 177; + int EN_AVOID = 178; /** Enumeration constant -- white-space shorthand */ - int EN_PRE = 178; + int EN_PRE = 179; /** Enumeration constant -- font shorthand */ - int EN_CAPTION = 179; + int EN_CAPTION = 180; /** Enumeration constant -- font shorthand */ - int EN_ICON = 180; + int EN_ICON = 181; /** Enumeration constant -- font shorthand */ - int EN_MENU = 181; + int EN_MENU = 182; /** Enumeration constant -- font shorthand */ - int EN_MESSAGE_BOX = 182; + int EN_MESSAGE_BOX = 183; /** Enumeration constant -- font shorthand */ - int EN_SMALL_CAPTION = 183; + int EN_SMALL_CAPTION = 184; /** Enumeration constant -- font shorthand */ - int EN_STATUS_BAR = 184; + int EN_STATUS_BAR = 185; /** Number of enumeration constants defined */ - int ENUM_COUNT = 184; + int ENUM_COUNT = 185; } --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8781henryheather@example.com Thu Jul 05 20:44:13 2007 Return-Path: <fop-commits-return-8781henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 70939 invoked from network); 5 Jul 2007 20:43:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Jul 2007 20:42:58 -0000 Received: (qmail 38505 invoked by uid 500); 5 Jul 2007 20:40:49 -0000 Delivered-To: henryheather@example.com Received: (qmail 38478 invoked by uid 500); 5 Jul 2007 20:40:49 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 38466 invoked by uid 99); 5 Jul 2007 20:40:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 13:40:48 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 13:40:45 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 701C21A981A; Thu, 5 Jul 2007 13:40:25 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553627 - /xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml Date: Thu, 05 Jul 2007 20:40:25 -0000 To: henryheather@example.com From: henryheather@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <henryheather@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: adelmelle Date: Thu Jul 5 13:40:24 2007 New Revision: 553627 URL: http://svn.apache.org/viewvc?view=rev&rev=553627 Log: Fix a broken link Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml?view=diff&rev=553627&r1=553626&r2=553627 ============================================================================== --- xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml (original) +++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml Thu Jul 5 13:40:24 2007 @@ -913,7 +913,7 @@ <answer> <p> FOP does not currently support this feature. Possible workarounds - include those mentioned in the <link href="#PDF-postprocess">PDF + include those mentioned in the <link href="0.93/output.html#pdf-postprocess">PDF Post-Processing FAQ</link>. </p> </answer> --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8786henryheather@example.com Fri Jul 06 06:30:03 2007 Return-Path: <fop-commits-return-8786henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 48017 invoked from network); 6 Jul 2007 06:22:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Jul 2007 06:22:44 -0000 Received: (qmail 10206 invoked by uid 500); 6 Jul 2007 12:22:45 -0000 Delivered-To: henryheather@example.com Received: (qmail 10179 invoked by uid 500); 6 Jul 2007 12:22:44 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 10168 invoked by uid 99); 6 Jul 2007 12:22:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 05:22:44 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 05:22:41 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 73B281A981D; Fri, 6 Jul 2007 05:22:21 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553859 - in /xmlgraphics/fop/trunk/src/documentation/content/xdocs: compliance.ihtml faq.xml Date: Fri, 06 Jul 2007 12:22:21 -0000 To: henryheather@example.com From: henryheather@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <henryheather@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: jeremias Date: Fri Jul 6 05:22:20 2007 New Revision: 553859 URL: http://svn.apache.org/viewvc?view=rev&rev=553859 Log: Clarification about the status of fo:bookmark support. Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/compliance.ihtml xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/compliance.ihtml URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/compliance.ihtml?view=diff&rev=553859&r1=553858&r2=553859 ============================================================================== --- xmlgraphics/fop/trunk/src/documentation/content/xdocs/compliance.ihtml (original) +++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/compliance.ihtml Fri Jul 6 05:22:20 2007 @@ -1499,15 +1499,16 @@ <td class="no"> no </td> - <td class="yes"> - yes + <td class="partial"> + partial </td> - <td class="yes"> - yes + <td class="partial"> + partial </td> <td align="left"> <ul> <li>[0.20.5] Uses the proprietary fox:outline extension.</li> + <li>[0.93] color, font-style and font-weight are not supported, yet.</li> </ul> </td> </tr> Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml?view=diff&rev=553859&r1=553858&r2=553859 ============================================================================== --- xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml (original) +++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/faq.xml Fri Jul 6 05:22:20 2007 @@ -912,9 +912,17 @@ <question>How do I control the Acrobat bookmark display?</question> <answer> <p> - FOP does not currently support this feature. Possible workarounds + FOP 0.20.5 does not support this feature. Possible workarounds include those mentioned in the <link href="0.93/output.html#pdf-postprocess">PDF Post-Processing FAQ</link>. + </p> + <p> + FOP versions 0.93 and later support the starting-state property of the XSL 1.1 + <link href="http://www.w3.org/TR/xsl11/#fo_bookmark">fo:bookmark</link> + element which can be used for this. The color, font-style and + font-weight properties on + <link href="http://www.w3.org/TR/xsl11/#fo_bookmark-title">fo:bookmark-title</link> + are not yet supported, though. </p> </answer> </faq> --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8784henryheather@example.com Fri Jul 06 06:33:38 2007 Return-Path: <fop-commits-return-8784henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 50764 invoked from network); 6 Jul 2007 06:24:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Jul 2007 06:24:31 -0000 Received: (qmail 45594 invoked by uid 500); 6 Jul 2007 09:24:31 -0000 Delivered-To: henryheather@example.com Received: (qmail 45573 invoked by uid 500); 6 Jul 2007 09:24:30 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 45561 invoked by uid 99); 6 Jul 2007 09:24:30 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 02:24:30 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 02:24:27 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 22EA51A981D; Fri, 6 Jul 2007 02:24:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553809 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Date: Fri, 06 Jul 2007 09:24:06 -0000 To: henryheather@example.com From: henryheather@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <henryheather@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: vhennebert Date: Fri Jul 6 02:24:06 2007 New Revision: 553809 URL: http://svn.apache.org/viewvc?view=rev&rev=553809 Log: Remove decrease of activeRowIndex when backtracking Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?view=diff&rev=553809&r1=553808&r2=553809 ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Fri Jul 6 02:24:06 2007 @@ -208,7 +208,7 @@ getTableLM().getHalfBorderSeparationBPD(), rowGroup)); } } - for (int i = activeRowIndex + 1; i < rowGroup.length; i++) { + for (int i = activeRowIndex + (rowBacktrackForLastStep ? 0 : 1); i < rowGroup.length; i++) { maxW += rowGroup[i].getHeight().opt; } log.debug("maxRemainingHeight=" + maxW); @@ -258,11 +258,6 @@ LinkedList returnList = new LinkedList(); while ((step = getNextStep()) >= 0) { int normalRow = activeRowIndex; - if (rowBacktrackForLastStep) { - //Even though we've already switched to the next row, we have to - //calculate as if we were still on the previous row - activeRowIndex--; - } int increase = step - laststep; int penaltyLen = step + getMaxRemainingHeight() - totalHeight; int boxLen = step - addedBoxLen - penaltyLen; @@ -394,10 +389,6 @@ } laststep = step; - if (rowBacktrackForLastStep) { - //If row was set to previous, restore now - activeRowIndex++; - } } if (signalKeepWithNext) { //Last step signalled a keep-with-next. Since the last penalty will be removed, --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8787henryheather@example.com Fri Jul 06 06:52:24 2007 Return-Path: <fop-commits-return-8787henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 68289 invoked from network); 6 Jul 2007 06:35:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Jul 2007 06:35:06 -0000 Received: (qmail 78446 invoked by uid 500); 6 Jul 2007 13:35:06 -0000 Delivered-To: henryheather@example.com Received: (qmail 78344 invoked by uid 500); 6 Jul 2007 13:35:05 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 78333 invoked by uid 99); 6 Jul 2007 13:35:05 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 06:35:05 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 06:35:02 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 29B0D1A981A; Fri, 6 Jul 2007 06:34:42 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553876 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Date: Fri, 06 Jul 2007 13:34:42 -0000 To: henryheather@example.com From: henryheather@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <henryheather@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: vhennebert Date: Fri Jul 6 06:34:41 2007 New Revision: 553876 URL: http://svn.apache.org/viewvc?view=rev&rev=553876 Log: Move the getNextStep method into ActiveCell Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?view=diff&rev=553876&r1=553875&r2=553876 ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Fri Jul 6 06:34:41 2007 @@ -62,8 +62,11 @@ private int paddingBefore; private int paddingAfter; private boolean keepWithNextSignal; + private int lastPenaltyLength; + private TableLayoutManager tableLM; - ActiveCell(PrimaryGridUnit pgu, EffRow row, int rowIndex) { + ActiveCell(PrimaryGridUnit pgu, EffRow row, int rowIndex, EffRow[] rowGroup, TableLayoutManager tableLM) { + this.tableLM = tableLM; this.pgu = pgu; boolean makeBoxForWholeRow = false; if (row.getExplicitHeight().min > 0) { @@ -106,6 +109,14 @@ width = 0; startRow = rowIndex; keepWithNextSignal = false; + computeBaseWidth(rowGroup); + } + + private void computeBaseWidth(EffRow[] rowGroup) { + baseWidth = 0; + for (int prevRow = 0; prevRow < startRow; prevRow++) { + baseWidth += rowGroup[prevRow].getHeight().opt; + } } private boolean endsOnRow(int rowIndex) { @@ -135,6 +146,47 @@ void backupWidth() { backupWidth = width; } + + int getNextStep() { + lastPenaltyLength = 0; + while (end + 1 < elementList.size()) { + end++; + KnuthElement el = (KnuthElement)elementList.get(end); + if (el.isPenalty()) { + if (el.getP() < KnuthElement.INFINITE) { + //First legal break point + lastPenaltyLength = el.getW(); + break; + } + } else if (el.isGlue()) { + if (end > 0) { + KnuthElement prev = (KnuthElement)elementList.get(end - 1); + if (prev.isBox()) { + //Second legal break point + break; + } + } + width += el.getW(); + } else { + width += el.getW(); + } + } + if (end < start) { +// if (log.isTraceEnabled()) { +// log.trace("column " + (i + 1) + ": (end=" + end + ") < (start=" + start +// + ") => resetting width to backupWidth"); +// } + width = backupWidth; + return 0; + } else { + return baseWidth + width + borderBefore + borderAfter + paddingBefore + + paddingAfter + 2 * tableLM.getHalfBorderSeparationBPD(); + } + } + + int getLastPenaltyLength() { + return lastPenaltyLength; + } } /** Logger **/ private static Log log = LogFactory.getLog(TableStepper.class); @@ -219,7 +271,7 @@ GridUnit gu = getActiveGridUnit(column); EffRow row = getActiveRow(); if (gu != null && !gu.isEmpty() && gu.isPrimary()) { - activeCells.add(new ActiveCell((PrimaryGridUnit) gu, row, activeRowIndex)); + activeCells.add(new ActiveCell((PrimaryGridUnit) gu, row, activeRowIndex, rowGroup, getTableLM())); } } @@ -423,80 +475,23 @@ goToNextRowIfCurrentFinished(); //Get next possible sequence for each cell + //Determine smallest possible step + int minStep = Integer.MAX_VALUE; boolean stepFound = false; for (Iterator iter = activeCells.iterator(); iter.hasNext();) { ActiveCell activeCell = (ActiveCell) iter.next(); - while (activeCell.end + 1 < activeCell.elementList.size()) { - activeCell.end++; - KnuthElement el = (KnuthElement)activeCell.elementList.get(activeCell.end); - if (el.isPenalty()) { - this.lastMaxPenaltyLength = Math.max(this.lastMaxPenaltyLength, el.getW()); - if (el.getP() <= -KnuthElement.INFINITE) { - log.debug("FORCED break encountered!"); - break; - } else if (el.getP() < KnuthElement.INFINITE) { - //First legal break point - break; - } - } else if (el.isGlue()) { - if (activeCell.end > 0) { - KnuthElement prev = (KnuthElement)activeCell.elementList.get(activeCell.end - 1); - if (prev.isBox()) { - //Second legal break point - break; - } - } - activeCell.width += el.getW(); - } else { - activeCell.width += el.getW(); - } - } - if (activeCell.end < activeCell.start) { -// if (log.isTraceEnabled()) { -// log.trace("column " + (i + 1) + ": (end=" + activeCell.end + ") < (start=" + activeCell.start -// + ") => resetting width to backupWidth"); -// } - activeCell.width = activeCell.backupWidth; - } else { + int nextStep = activeCell.getNextStep(); + if (nextStep > 0) { stepFound = true; + minStep = Math.min(minStep, nextStep); + lastMaxPenaltyLength = Math.max(lastMaxPenaltyLength, activeCell + .getLastPenaltyLength()); } - //log.debug("part " + activeCell.start + "-" + activeCell.end + " " + activeCell.width); -// if (log.isTraceEnabled()) { -// log.trace("column " + (i+1) + ": borders before=" + activeCell.borderBefore + " after=" + activeCell.borderAfter); -// log.trace("column " + (i+1) + ": padding before=" + activeCell.paddingBefore + " after=" + activeCell.paddingAfter); -// } } if (!stepFound) { return -1; } - //Determine smallest possible step - int minStep = Integer.MAX_VALUE; - StringBuffer sb = new StringBuffer(); - for (Iterator iter = activeCells.iterator(); iter.hasNext();) { - ActiveCell activeCell = (ActiveCell) iter.next(); - activeCell.baseWidth = 0; - for (int prevRow = 0; prevRow < activeCell.startRow; prevRow++) { - activeCell.baseWidth += rowGroup[prevRow].getHeight().opt; - } - activeCell.baseWidth += 2 * getTableLM().getHalfBorderSeparationBPD(); - activeCell.baseWidth += activeCell.borderBefore + activeCell.borderAfter; - activeCell.baseWidth += activeCell.paddingBefore + activeCell.paddingAfter; - if (activeCell.end >= activeCell.start) { - int len = activeCell.baseWidth + activeCell.width; - sb.append(len + " "); - minStep = Math.min(len, minStep); - } - } - if (log.isDebugEnabled()) { - log.debug("candidate steps: " + sb); - } - - //Check for constellations that would result in overlapping borders - /* - for (int i = 0; i < columnCount; i++) { - - }*/ //Reset bigger-than-minimum sequences //See http://people.apache.org/~jeremias/fop/NextStepAlgoNotes.pdf @@ -504,18 +499,13 @@ skippedStep = false; for (Iterator iter = activeCells.iterator(); iter.hasNext();) { ActiveCell activeCell = (ActiveCell) iter.next(); - int len = activeCell.baseWidth + activeCell.width; + int len = activeCell.baseWidth + activeCell.width + activeCell.borderBefore + activeCell.borderAfter + activeCell.paddingBefore + + activeCell.paddingAfter + 2 * getTableLM().getHalfBorderSeparationBPD(); if (len > minStep) { activeCell.width = activeCell.backupWidth; activeCell.end = activeCell.start - 1; - if (activeCell.baseWidth + activeCell.width > minStep) { -// if (log.isDebugEnabled()) { -// log.debug("column " -// + (i + 1) -// + ": minStep vs. border/padding increase conflict: basewidth + width = " -// + activeCell.baseWidth + " + " + activeCell.width + " = " -// + (activeCell.baseWidth + activeCell.width)); -// } + if (activeCell.baseWidth + activeCell.borderBefore + activeCell.borderAfter + activeCell.paddingBefore + + activeCell.paddingAfter + 2 * getTableLM().getHalfBorderSeparationBPD() + activeCell.width > minStep) { if (activeRowIndex == 0) { log.debug(" First row. Skip this step."); skippedStep = true; @@ -529,17 +519,6 @@ } } } -// if (log.isDebugEnabled()) { -// /*StringBuffer*/ sb = new StringBuffer("[col nb: start-end(width)] "); -// for (int i = 0; i < columnCount; i++) { -// if (end[i] >= start[i]) { -// sb.append(i + ": " + start[i] + "-" + end[i] + "(" + widths[i] + "), "); -// } else { -// sb.append(i + ": skip, "); -// } -// } -// log.debug(sb.toString()); -// } return minStep; } --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8788henryheather@example.com Fri Jul 06 07:11:15 2007 Return-Path: <fop-commits-return-8788henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 95899 invoked from network); 6 Jul 2007 06:49:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Jul 2007 06:49:37 -0000 Received: (qmail 10440 invoked by uid 500); 6 Jul 2007 13:49:37 -0000 Delivered-To: henryheather@example.com Received: (qmail 10417 invoked by uid 500); 6 Jul 2007 13:49:37 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 10406 invoked by uid 99); 6 Jul 2007 13:49:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 06:49:37 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 06:49:33 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id A39AB1A981A; Fri, 6 Jul 2007 06:49:13 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553878 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Date: Fri, 06 Jul 2007 13:49:13 -0000 To: henryheather@example.com From: henryheather@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <henryheather@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: vhennebert Date: Fri Jul 6 06:49:12 2007 New Revision: 553878 URL: http://svn.apache.org/viewvc?view=rev&rev=553878 Log: Add a signalMinStep method in ActiveCell Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?view=diff&rev=553878&r1=553877&r2=553878 ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Fri Jul 6 06:49:12 2007 @@ -184,6 +184,19 @@ } } + boolean signalMinStep(int minStep) { + int len = baseWidth + width + borderBefore + borderAfter + paddingBefore + paddingAfter + + 2 * tableLM.getHalfBorderSeparationBPD(); + if (len > minStep) { + width = backupWidth; + end = start - 1; + return baseWidth + borderBefore + borderAfter + paddingBefore + + paddingAfter + 2 * tableLM.getHalfBorderSeparationBPD() + width > minStep; + } else { + return false; + } + } + int getLastPenaltyLength() { return lastPenaltyLength; } @@ -499,23 +512,16 @@ skippedStep = false; for (Iterator iter = activeCells.iterator(); iter.hasNext();) { ActiveCell activeCell = (ActiveCell) iter.next(); - int len = activeCell.baseWidth + activeCell.width + activeCell.borderBefore + activeCell.borderAfter + activeCell.paddingBefore - + activeCell.paddingAfter + 2 * getTableLM().getHalfBorderSeparationBPD(); - if (len > minStep) { - activeCell.width = activeCell.backupWidth; - activeCell.end = activeCell.start - 1; - if (activeCell.baseWidth + activeCell.borderBefore + activeCell.borderAfter + activeCell.paddingBefore - + activeCell.paddingAfter + 2 * getTableLM().getHalfBorderSeparationBPD() + activeCell.width > minStep) { - if (activeRowIndex == 0) { - log.debug(" First row. Skip this step."); - skippedStep = true; - } else { - log.debug(" row-span situation: backtracking to last row"); - //Stay on the previous row for another step because borders and padding on - //columns may make their contribution to the step bigger than the addition - //of the next element for this step would make the step to grow. - rowBacktrackForLastStep = true; - } + if (activeCell.signalMinStep(minStep)) { + if (activeRowIndex == 0) { + log.debug(" First row. Skip this step."); + skippedStep = true; + } else { + log.debug(" row-span situation: backtracking to last row"); + //Stay on the previous row for another step because borders and padding on + //columns may make their contribution to the step bigger than the addition + //of the next element for this step would make the step to grow. + rowBacktrackForLastStep = true; } } } @@ -532,7 +538,7 @@ } } - private void goToNextRowIfCurrentFinished() { + private void goToNextRowIfCurrentFinished() { // We assume that the current grid row is finished. If this is not the case this // boolean will be reset (see below) boolean currentGridRowFinished = true; --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8785henryheather@example.com Fri Jul 06 07:30:11 2007 Return-Path: <fop-commits-return-8785henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 20317 invoked from network); 6 Jul 2007 07:02:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Jul 2007 07:02:23 -0000 Received: (qmail 19568 invoked by uid 500); 6 Jul 2007 10:02:23 -0000 Delivered-To: henryheather@example.com Received: (qmail 19551 invoked by uid 500); 6 Jul 2007 10:02:23 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 19536 invoked by uid 99); 6 Jul 2007 10:02:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 03:02:23 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 03:02:20 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id EBF041A981A; Fri, 6 Jul 2007 03:01:59 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553824 - /xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml Date: Fri, 06 Jul 2007 10:01:59 -0000 To: henryheather@example.com From: henryheather@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <henryheather@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: vhennebert Date: Fri Jul 6 03:01:58 2007 New Revision: 553824 URL: http://svn.apache.org/viewvc?view=rev&rev=553824 Log: Add a testcase for a bug in TableStepper spotted during the refactoring. The border-before of the primary grid unit was taken into account instead of the whole cell border. If the cell is spanning over two columns and the border-before for the second grid unit is bigger, this was leading to a wrong step computation. Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml (with props) Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml?view=auto&rev=553824 ============================================================================== --- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml (added) +++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml Fri Jul 6 03:01:58 2007 @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<testcase> + <info> + <p> + This test checks that TableStepper computes steps correctly in the following condition: + collapsing borders, a cell spanning over two columns, the border-before on the grid unit of + the second column bigger than on the first column. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="page" page-height="7cm" page-width="15cm" margin="1cm" + margin-bottom="0"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="page" font-family="serif" font-size="14pt"> + <fo:flow flow-name="xsl-region-body"> + <fo:block space-after="80pt">Before the table</fo:block> + <fo:table width="100%" table-layout="fixed" border="4pt solid black"> + <fo:table-column number-columns-repeated="2" + column-width="proportional-column-width(1)"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell border="2pt solid blue"> + <fo:block>Cell 1.1</fo:block> + </fo:table-cell> + <fo:table-cell border="2pt solid blue"> + <fo:block>Cell 1.2</fo:block> + </fo:table-cell> + <fo:table-cell border="2pt solid teal" border-bottom-width="40pt"> + <!-- This big border-bottom prevents the second row of the table from fitting on + the first page --> + <fo:block>Cell 1.3</fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell border="2pt solid blue"> + <fo:block>Cell 2.1</fo:block> + <fo:block>Cell 2.1</fo:block> + </fo:table-cell> + <fo:table-cell border="2pt solid blue" number-columns-spanned="2"> + <fo:block>Cell 2.2</fo:block> + <fo:block>Cell 2.2</fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + <fo:block space-before="0pt">After the table</fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <!-- 2 pages --> + <eval expected="2" xpath="count(//pageViewport)"/> + <!-- 2 blocks on the first page: "Before the table" plus the table itself --> + <eval expected="2" xpath="count(//pageViewport[1]//flow/block)"/> + <!-- 3 blocks in the table, corresponding to the first row --> + <eval expected="3" xpath="count(//pageViewport[1]//flow/block[2]/block)"/> + <eval expected="2" xpath="count(//pageViewport[2]//flow/block)"/> + <!-- the rest of the table on the second page --> + <eval expected="4" xpath="count(//pageViewport[2]//flow/block[1]/block)"/> + </checks> +</testcase> Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-stepper_colspan_border-before.xml ------------------------------------------------------------------------------ svn:keywords = Id --------------------------------------------------------------------- To unsubscribe, e-mail: henryheather@example.com For additional commands, e-mail: henryheather@example.com From fop-commits-return-8782henryheather@example.com Fri Jul 06 07:37:35 2007 Return-Path: <fop-commits-return-8782henryheather@example.com> Delivered-To: henryheather@example.com Received: (qmail 32810 invoked from network); 6 Jul 2007 07:08:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Jul 2007 07:08:52 -0000 Received: (qmail 48401 invoked by uid 500); 6 Jul 2007 08:42:12 -0000 Delivered-To: henryheather@example.com Received: (qmail 48373 invoked by uid 500); 6 Jul 2007 08:42:12 -0000 Mailing-List: contact henryheather@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:henryheather@example.com> List-Unsubscribe: <mailto:henryheather@example.com> List-Post: <mailto:henryheather@example.com> List-Id: <fop-commits.xmlgraphics.apache.org> Reply-To: henryheather@example.com Delivered-To: mailing list henryheather@example.com Received: (qmail 48359 invoked by uid 99); 6 Jul 2007 08:42:12 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 01:42:12 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2007 01:42:08 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id CA5FA1A981A; Fri, 6 Jul 2007 01:41:47 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r553790 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr: KnuthPenalty.java table/TableStepper.java Date: Fri, 06 Jul 2007 08:41:47 -0000 To: henryheather@example.com From: henryheather@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <henryheather@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: vhennebert Date: Fri Jul 6 01:41:46 2007 New Revision: 553790 URL: http://svn.apache.org/viewvc?view=rev&rev=553790 Log: First step towards using a list of active cells for computing steps Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java?view=diff&rev=553790&r1=553789&r2=553790 ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java Fri Jul 6 01:41:46 2007 @@ -111,14 +111,17 @@ return penalty == -KnuthElement.INFINITE; } - /** @return the break class of this penalty (one of the break-* constants) */ + /** + * @return the break class of this penalty (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE, + * EN_ODD_PAGE) + */ public int getBreakClass() { return breakClass; } /** * Sets the break class for this penalty. - * @param cl the break class (one of the break-* constants) + * @param cl the break class (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE, EN_ODD_PAGE) */ public void setBreakClass(int cl) { this.breakClass = cl; Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?view=diff&rev=553790&r1=553789&r2=553790 ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Fri Jul 6 01:41:46 2007 @@ -20,6 +20,7 @@ package org.apache.fop.layoutmgr.table; import java.util.Arrays; +import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -40,53 +41,118 @@ */ public class TableStepper { + private static class ActiveCell { + private PrimaryGridUnit pgu; + /** Knuth elements for this active cell. */ + private List elementList; + /** Number of the row where the row-span begins, zero-based. */ + private int startRow; + /** Index, in the list of Knuth elements, of the element starting the current step. */ + private int start; + /** Index, in the list of Knuth elements, of the element ending the current step. */ + private int end; + /** + * Total length of the Knuth elements already included in the steps, up to the + * current one. + */ + private int width; + private int backupWidth; + private int baseWidth; + private int borderBefore; + private int borderAfter; + private int paddingBefore; + private int paddingAfter; + private boolean keepWithNextSignal; + + ActiveCell(PrimaryGridUnit pgu, EffRow row, int rowIndex) { + this.pgu = pgu; + boolean makeBoxForWholeRow = false; + if (row.getExplicitHeight().min > 0) { + boolean contentsSmaller = ElementListUtils.removeLegalBreaks( + pgu.getElements(), row.getExplicitHeight()); + if (contentsSmaller) { + makeBoxForWholeRow = true; + } + } + if (pgu.isLastGridUnitRowSpan() && pgu.getRow() != null) { + makeBoxForWholeRow |= pgu.getRow().mustKeepTogether(); + makeBoxForWholeRow |= pgu.getTable().mustKeepTogether(); + } + if (makeBoxForWholeRow) { + elementList = new java.util.ArrayList(1); + int height = row.getExplicitHeight().opt; + if (height == 0) { + height = row.getHeight().opt; + } + elementList.add(new KnuthBoxCellWithBPD(height)); + } else { + //Copy elements (LinkedList) to array lists to improve + //element access performance + elementList = new java.util.ArrayList(pgu.getElements()); +// if (log.isTraceEnabled()) { +// log.trace("column " + (column+1) + ": recording " + elementLists.size() + " element(s)"); +// } + } + if (pgu.getTable().isSeparateBorderModel()) { + borderBefore = pgu.getBorders().getBorderBeforeWidth(false); + borderAfter = pgu.getBorders().getBorderAfterWidth(false); + } else { + borderBefore = pgu.getHalfMaxBeforeBorderWidth(); + borderAfter = pgu.getHalfMaxAfterBorderWidth(); + } + paddingBefore = pgu.getBorders().getPaddingBefore(false, pgu.getCellLM()); + paddingAfter = pgu.getBorders().getPaddingAfter(false, pgu.getCellLM()); + start = 0; + end = -1; + width = 0; + startRow = rowIndex; + keepWithNextSignal = false; + } + + private boolean endsOnRow(int rowIndex) { + return rowIndex == startRow + pgu.getCell().getNumberRowsSpanned() - 1; + } + + int getRemainingHeight(int activeRowIndex, int halfBorderSeparationBPD, EffRow[] rowGroup) { + if (end == elementList.size() - 1) { + return 0; + } + if (!endsOnRow(activeRowIndex)) { + return 0; + } + int len = width; + if (len > 0) { + len += 2 * halfBorderSeparationBPD; + len += borderBefore + borderAfter; + len += paddingBefore + paddingAfter; + } + int nominalHeight = 0; + for (int r = startRow; r < startRow + pgu.getCell().getNumberRowsSpanned(); r++) { + nominalHeight += rowGroup[r].getHeight().opt; + } + return nominalHeight - len; + } + + void backupWidth() { + backupWidth = width; + } + } /** Logger **/ private static Log log = LogFactory.getLog(TableStepper.class); private TableContentLayoutManager tclm; - + private EffRow[] rowGroup; /** Number of columns in the row group. */ private int columnCount; private int totalHeight; private int activeRowIndex; - /** - * Knuth elements for active cells, per column. Active cells are cells spanning over - * the currently active row. - */ - private List[] elementLists; - /** - * Number of the row where the row-span begins, per column. Zero-based. - */ - private int[] startRow; - /** - * For each column, index, in the cell's list of Knuth elements, of the element - * starting the current step. - */ - private int[] start; - /** - * For each column, index, in the cell's list of Knuth elements, of the element - * ending the current step. - */ - private int[] end; - /** - * For each column, widths of the Knuth elements already included in the steps, up to - * the current one. - */ - private int[] widths; - /** - * ?? Width from the start of the row-group up to the current row. - */ - private int[] baseWidth; - private int[] borderBefore; - private int[] paddingBefore; - private int[] borderAfter; - private int[] paddingAfter; private boolean rowBacktrackForLastStep; private boolean skippedStep; - private boolean[] keepWithNextSignals; private int lastMaxPenaltyLength; - + + private List activeCells = new LinkedList(); + /** * Main constructor * @param tclm The parent TableContentLayoutManager @@ -103,18 +169,6 @@ private void setup(int columnCount) { this.columnCount = columnCount; this.activeRowIndex = 0; - elementLists = new List[columnCount]; - startRow = new int[columnCount]; - start = new int[columnCount]; - end = new int[columnCount]; - widths = new int[columnCount]; - baseWidth = new int[columnCount]; - borderBefore = new int[columnCount]; - paddingBefore = new int[columnCount]; - borderAfter = new int[columnCount]; - paddingAfter = new int[columnCount]; - keepWithNextSignals = new boolean[columnCount]; - Arrays.fill(end, -1); } /** @@ -125,7 +179,7 @@ private EffRow getActiveRow() { return rowGroup[activeRowIndex]; } - + /** * Returns the grid unit at the given column number on the active row. * @@ -136,7 +190,7 @@ private GridUnit getActiveGridUnit(int column) { return getActiveRow().safelyGetGridUnit(column); } - + private PrimaryGridUnit getActivePrimaryGridUnit(int column) { GridUnit gu = getActiveGridUnit(column); if (gu == null) { @@ -145,7 +199,7 @@ return gu.getPrimary(); } } - + private void calcTotalHeight() { totalHeight = 0; for (int i = 0; i < rowGroup.length; i++) {
{'source': 'Apache Software Foundation Public Mail Archives'}