[XML Graphics - FOP Wiki] Updated: PageLayout

2005-03-01 Thread fop-cvs
   Date: 2005-03-01T00:54:54
   Editor: 81.221.219.138
   Wiki: XML Graphics - FOP Wiki
   Page: PageLayout
   URL: http://wiki.apache.org/xmlgraphics-fop/PageLayout

   Comment on look-ahead strategies

Change Log:

--
@@ -138,7 +138,7 @@
 stretchability/shrinkability on the page. This strategy is used by TeX
 in its vertical list.
 
-The next possible strategy uses look ahead. There is a sliding window
+The next possible strategy uses look ahead [1]. There is a sliding window
 of ''N'' pages. The best page breaks are calculated over all pages in the
 window, but only the page break of the first page is used. Then the
 window is moved forward one page, and the effort is repeated. This
@@ -151,6 +151,17 @@
 A total-fit strategy, as used in paragraph breaking, can only be
 applied to a complete page sequence. This will almost always to
 expensive, both in computing effort and in memory requirements.
+
+
+
+''[1] JM: One problem I see with a look-ahead approach is the different 
+available IPD value on subsequent pages which would cause too much 
+recalculation of the lines (and table layouts if auto-layout is active). 
+In line-breaking we only have constant boxes while in page-breaking the 
+boxes have different dimensions due to other line breaking decisions 
+being made. Too much look ahead can cause too much wasted effort in 
+complex documents. (See 
+[http://cvs.apache.org/viewcvs.cgi/xml-fop/test/layoutengine/testcases/normal-breaking4.xml
 normal-breaking4.xml])''
 
 == Layout around a page break ==
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[XML Graphics - FOP Wiki] New: PageLayout/InfluencingFeatures

2005-03-01 Thread fop-cvs
   Date: 2005-03-01T05:08:37
   Editor: JeremiasMaerki
   Wiki: XML Graphics - FOP Wiki
   Page: PageLayout/InfluencingFeatures
   URL: http://wiki.apache.org/xmlgraphics-fop/PageLayout/InfluencingFeatures

   List of all elements that influence page breaking

New Page:

= Things influencing page breaking =

This page tries to list all the elements that influence page breaking. This 
should help determine the right approach.

== available IPD ==

The available IPD has influence on line breaking. Each line may be a BP. The 
available IPD may be different between two pages, ex. the first page in 
portrait mode the second in landscape. Also, a block with span=all in a 
'''multi-column page''' has a different available IPD than a block with 
span=none. '''Side-floats''' also have an influence on the available IPD. In 
this case, it's even more complicated because the line breaking mechanism has 
to know the available IPD for each an every line.

== spacing ==

space-before and space-after add conditional or unconditional lengths in BPD.

== keeps and breaks ==

Keeps and Breaks add conditional or unconditional constraints to the boxes to 
be layed out.

== widows and orphans ==

These attributes are special keep situations.

== multi-column layout ==

Multi-column layout not only has an influence on the available IPD, spans may 
split up the available content area. Furthermore, spans cause the preceding 
parts to be balanced in their columns (sub-pages). Only then is the starting 
point in BPD known and therefore the remaining available BPD.

== tables ==

Table headers and footers (and table-omit-header|footer-at-break) have an 
influence on the allocated BPD. With the border collapsing model there are 
additional influences on the allocated BPD by the complex interactions between 
the individual borders. The presence or absence of an adjacent table header or 
footer also additionally interacts with the decision for an effective cell 
border. See CollapsingBorderModel.

== footnotes ==

Footnotes use up BPD and grow upwards from the bottom of the available BPD.

== last-page layout ==

When the the flow runs out of FOs the last page is reached and the current page 
should be converted to the last page and re-layouted. If the last page provides 
less BPD than the next-to-last page it may be that the last page actually 
overflows. (In this case the now next-to-last page should probably be again 
re-layouted with the previous page-master but with the available BPD of the 
last-page (to get the headers and footers right.)

== references (page-number and page-number-citations) ==

This is only applicable if there is a plan to replace the reserved space for 
these FOs by the effective space used.



See also:
 * [http://xml.apache.org/fop/design/layout.html]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[XML Graphics - FOP Wiki] Updated: DeveloperPages

2005-03-01 Thread fop-cvs
   Date: 2005-03-01T05:12:35
   Editor: JeremiasMaerki
   Wiki: XML Graphics - FOP Wiki
   Page: DeveloperPages
   URL: http://wiki.apache.org/xmlgraphics-fop/DeveloperPages

   Link to new page

Change Log:

--
@@ -7,6 +7,7 @@
 
  * CollapsingBorderModel
  * PageLayout
+   * PageLayout/InfluencingFeatures
  * TableLayout
  * BreakPossSignallingFullPage 
  * [wiki:FopAndJava2D FopAndJava2D]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/documentation/content/xdocs/DnI getnextbreakposs.xml areatree.xml

2005-03-01 Thread spepping
spepping2005/03/01 12:47:48

  Modified:src/documentation/content/xdocs/DnI getnextbreakposs.xml
areatree.xml
  Log:
  Patch 33597 by Renaud Richardet, and a few other edits
  
  Revision  ChangesPath
  1.2   +54 -73
xml-fop/src/documentation/content/xdocs/DnI/getnextbreakposs.xml
  
  Index: getnextbreakposs.xml
  ===
  RCS file: 
/home/cvs/xml-fop/src/documentation/content/xdocs/DnI/getnextbreakposs.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- getnextbreakposs.xml  1 Aug 2004 19:48:51 -   1.1
  +++ getnextbreakposs.xml  1 Mar 2005 20:47:48 -   1.2
  @@ -103,55 +103,39 @@
   paraChild layout managers are created and retrieved in the method
   literalAbstractLayoutManager.getChildLM/literal./para
   
  -paraThe layout manager has a layout strategy, which has an
  -literalAddLMVisitor/literal object, which is responsible for
  -creating layout managers for the FO nodes./para
  -
  -paraThe layout manager gets the layout manager for its next child from its
  -literalLMIter/literal object literalchildLMIter/literal. This
  -literalLMIter/literal object contains an iterator over the
  -children of the layout manager's FO node. It behaves itself as an
  -iterator over the list of layout managers for the children. It
  -constructs those layout managers when needed, in its
  -literalpreLoadNext/literal method. It does so by calling the
  -layout strategy's literalAddLMVisitor/literal object's
  -literaladdLayoutManager/literal method. The
  -literalLMIter/literal object gets the layout strategy via the
  -current layout manager, which it knows./para
  -
  -paraliteralAddLMVisitor/literal's literaladdLayoutManager/literal
  -method first registers the LM list in its second argument, i.e. the
  -literalLMIter/literal object's LM list, as its own member
  -literalcurrentLMlist/literal. Then it asks the FO node to accept
  -it as the literalFOTreeVisitor/literal
  -(literalacceptVisitor/literal). The FO node then calls the
  -appropriate method of this FO tree visitor, in this case
  -(literalfo:flow/literal) the method literalserveFlow/literal
  -(literalAddLMVisitor.serveFlow/literal). This method creates a
  -literalFlowLayoutManager/literal object and adds it to the
  -literalcurrentLMList/literal. Thus literalLMIter/literal has a
  -layout manager for its next child.  It returns this layout manager in
  -the call to its literalnext()/literal method, when the current
  -layout manager invokes its literalgetChildLM/literal method./para
  -
  -paraNote that layout manager types may have their own subclass of
  -literalLMIter/literal,
  -e.g. literalBlockLayoutManager$BlockLMiter/literal and
  -literalAbstractList$ListItr/literal, which may implement a
  -different method of creating child layout managers./para
  -
  -paraThe method literalacceptVisitor/literal of the FO node calls the
  -appropriate method of its visitor. This procedure effectively
  -implements an indirect mapping from FO node type to layout
  -manager. The indirection allows the literalAddLMVisitor/literal
  -object to return its own layout manager for each FO node type. Because
  -the literalAddLMVisitor/literal object is part of the layout
  -strategy, this indirection allows the layout strategy to provide its
  -own layout managers for the layout process. In this manner, a
  -different layout strategy can be coupled to the other parts of the
  -program./para
  +paraThe layout manager gets the layout manager for its next child
  +from its literalLMIter/literal object
  +literalchildLMIter/literal. This literalLMIter/literal object
  +contains an iterator over the children of the layout manager's FO
  +node. It behaves itself as an iterator over the list of layout
  +managers for the children. It constructs those layout managers when
  +needed, in its literalpreLoadNext/literal method, which calls the
  +convenience method literalpreLoadList/literal.  Using the iterator
  +literalfobjIter/literal, literalpreLoadList/literal iterates
  +through the children of the current FO-Object and preloads the
  +corresponding LMs
  +(literalLayoutManagerMaker.makeLayoutManagers()/literal).  Thus
  +literalLMIter/literal has a layout manager for its next child.  It
  +returns this layout manager in the call to its
  +literalnext()/literal method, when the current layout manager
  +invokes its literalgetChildLM/literal method./para
  +
  +paraliteralBlockLayoutManager.ProxyLMiter/literal has
  +its own subclass of literalLMIter/literal, which implements a
  +different method of creating child layout managers. See the link
  +linkend=sec.blocklmnext
  +section/link./para
  +
  +paraThe method that creates the LMs,
  +literalLayoutManagerMaker.makeLayoutManagers()/literal, is
  +implemented by FOP's implementation of the
  +literalLayoutManagerMaker/literal interface,
  

cvs commit: xml-fop/src/documentation/content/xdocs/DnI DnI.xml getnextbreakposs.xml

2005-03-01 Thread spepping
spepping2005/03/01 13:29:37

  Modified:src/documentation/content/xdocs/DnI DnI.xml
getnextbreakposs.xml
  Log:
  A few more changes
  
  Revision  ChangesPath
  1.2   +16 -2 xml-fop/src/documentation/content/xdocs/DnI/DnI.xml
  
  Index: DnI.xml
  ===
  RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/DnI/DnI.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DnI.xml   9 Nov 2004 20:56:33 -   1.1
  +++ DnI.xml   1 Mar 2005 21:29:37 -   1.2
  @@ -1,7 +1,7 @@
   ?xml version=1.0 encoding=utf-8?
   
   !--
  -  * Copyright 2004 The Apache Software Foundation.
  +  * Copyright 2004-2005 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
  @@ -47,10 +47,19 @@
  orgdivApache Software Foundation/orgdiv
   /affiliation
 /author
  +   author
  + firstnameRenaud/firstname
  + surnameRichardet/surname
  + affiliation
  +   orgnameFOP contributor/orgname
  +   orgdivApache Software Foundation/orgdiv
  +/affiliation
  +  /author
   /authorgroup
   
copyright
  year2004/year
  +   year2005/year
  holderThe Apache Software Foundation/holder
/copyright
   
  @@ -81,6 +90,11 @@
date01 August 2004/date
revremarkCommitted to the FOP code repository/revremark
  /revision
  +   revision
  + revnumber1.0.x/revnumber
  + date2005/date
  + revremarkVarious updates, see the FOP code 
repository/revremark
  +   /revision
/revhistory
   
abstract
  
  
  
  1.3   +2 -2  
xml-fop/src/documentation/content/xdocs/DnI/getnextbreakposs.xml
  
  Index: getnextbreakposs.xml
  ===
  RCS file: 
/home/cvs/xml-fop/src/documentation/content/xdocs/DnI/getnextbreakposs.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- getnextbreakposs.xml  1 Mar 2005 20:47:48 -   1.2
  +++ getnextbreakposs.xml  1 Mar 2005 21:29:37 -   1.3
  @@ -1,7 +1,7 @@
   ?xml version=1.0 encoding=utf-8?
   
   !--
  -  * Copyright 2004 The Apache Software Foundation.
  +  * Copyright 2004-2005 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: xml-fop/src/java/org/apache/fop/apps FOUserAgent.java

2005-03-01 Thread gmazza
gmazza  2005/03/01 17:59:40

  Modified:src/java/org/apache/fop/fo/flow TableBody.java
TableFooter.java
   src/java/org/apache/fop/apps FOUserAgent.java
  Log:
  Flag added in FOUserAgent for strict/unstrict validation (see TableBody to 
see how used.)
  Validation added (only strict version) for TableFooter.
  
  Revision  ChangesPath
  1.39  +47 -5 xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java
  
  Index: TableBody.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- TableBody.java23 Feb 2005 22:04:01 -  1.38
  +++ TableBody.java2 Mar 2005 01:59:40 -   1.39
  @@ -22,11 +22,14 @@
   import java.util.Iterator;
   import java.util.List;
   
  +import org.xml.sax.Locator;
  +
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.PropertyList;
   import org.apache.fop.fo.StaticPropertyList;
  +import org.apache.fop.fo.ValidationException;
   import org.apache.fop.fo.properties.CommonAccessibility;
   import org.apache.fop.fo.properties.CommonAural;
   import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
  @@ -34,7 +37,6 @@
   
   /**
* Class modelling the fo:table-body object.
  - * @todo implement validateChildNode()
*/
   public class TableBody extends FObj {
   // The value of properties relevant for fo:table-body.
  @@ -50,6 +52,9 @@
   // End of property values
   
   private PropertyList savedPropertyList;
  +
  +private boolean tableRowsFound = false;
  +private boolean tableColumnsFound = false;   
   
   /**
* @param parent FONode that is the parent of the object
  @@ -88,15 +93,52 @@
*/
   protected void endOfNode() throws FOPException {
   getFOEventHandler().endBody(this);
  -if (childNodes == null || childNodes.size() == 0) {
  -getLogger().error(fo:table-body must not be empty. 
  -+ Expected: (table-row+|table-cell+));
  -getParent().removeChild(this);
  +if (!(tableRowsFound || tableColumnsFound)) {
  +if (getUserAgent().validateStrictly()) {
  +missingChildElementError(marker* (table-row+|table-cell+));
  +} else {
  +getLogger().error(fo:table-body must not be empty. 
  ++ Expected: marker* (table-row+|table-cell+));
  +getParent().removeChild(this);
  +}
   }
   convertCellsToRows();
   }
   
   /**
  + * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, 
String)
  + * XSL Content Model: marker* (table-row+|table-cell+)
  + */
  +protected void validateChildNode(Locator loc, String nsURI, String 
localName) 
  +throws ValidationException {
  +if (nsURI == FO_URI) {
  +if (localName.equals(marker)) {
  +if (tableRowsFound || tableColumnsFound) {
  +   nodesOutOfOrderError(loc, fo:marker, 
(table-row+|table-cell+));
  +}
  +} else if (localName.equals(table-row)) {
  +tableRowsFound = true;
  +if (tableColumnsFound) {
  +invalidChildError(loc, nsURI, localName, Either 
fo:table-rows +
  +   or fo:table-columns may be children of an 
fo:table-body +
  +   but not both);
  +}
  +} else if (localName.equals(table-column)) {
  +tableColumnsFound = true;
  +if (tableRowsFound) {
  +invalidChildError(loc, nsURI, localName, Either 
fo:table-rows +
  +   or fo:table-columns may be children of an 
fo:table-body +
  +   but not both);
  +}  
  +} else {
  +invalidChildError(loc, nsURI, localName);
  +}
  +} else {
  +invalidChildError(loc, nsURI, localName);
  +}
  +}
  +
  +/**
* If table-cells are used as direct children of a 
table-body|header|footer
* they are replace in this method by proper table-rows.
* @throws FOPException if there's a problem binding the TableRows 
properties.
  
  
  
  1.12  +58 -1 xml-fop/src/java/org/apache/fop/fo/flow/TableFooter.java
  
  Index: TableFooter.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableFooter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TableFooter.java  25 Aug 2004 05:03:06 -  1.11
  +++ TableFooter.java  2 Mar 2005 01:59:40 -