Back to FOPProjectPages

FOP Layout

This is just a starting point to put down some ideas about the layout.

The steps to doing the layout:

  • actual structure of each layout process (eg. table contains rows/cells breaks across rows)
  • determining breaks and the constrain/distance for that break
  • adding areas from break information

What needs to be avoided:

  • linking the layout structure with the breaks
  • making breaks and other information too stateful
  • making it too complicated to start from a previous position

Reflows need to be easy while still retaining useful information. Moving to a next or previous break needs to be easy, this should only effect following breaks. Calculating the distance between two breaks for a particular context should be easy. Resolving spaces and finding the constaints for a break should be easy. And finally adding areas based on the breaks should be simple.

Layout Managers

The Layout Managers can be used as a view for the for tree to construct Managers that will do the layout work. The layout implementation should implement this interface The interface contains methods for constructing the managers:

  • setting the FObj
  • setting the user agent

Layout Processor

The layout processor interface is used during the layout process, primarily for finding breaks in the flow or other parts so that the break can be used later. The LayoutProcessor extends the AreaBuilder interface.

Area Builder

The Area builder interface describes the way that the area tree in constructed. Only the page contents are actually constructed.

The AreaBuilder uses the breaks found by the layout process. These breaks describe a position in the flow that should be added to the area tree. The individual layout processors are then responsible for creating the areas and adding them to the parent area builder.


For block stacking only.

A break is a position in the layout processor heirarchy that is after a line area or some other atomic position that contains no other breaks. This break will always be inside a block and will either be inside the block somewhere or the last break of the block. This break can be used as is at any level of the layout managers to mark a position or to find information about the break. The break contains the refering layout processor.


The distance between two breaks can be found by starting at one break and asking each layout manager to calculate the distance. The start and end "breaks" are null. For space resolving the before spacing is resolved at the start and the after spacing is resolved separately. The resolving is done within the current context.

Next and Previous

The next or previous break can be found for any break. In the case of page columns the columns may need to be continually rebalanced. The result is that it is possible to find the distance required for the combination of the columns. To do this it will need to be able to located each column break, resolve the space and calulcate the distances. To do this effectively it will need to be possible to easily move the breaks backwards or forwards.

  • No labels