org.apache.fop.layout
Class BodyAreaContainer

java.lang.Object
  extended byorg.apache.fop.layout.Box
      extended byorg.apache.fop.layout.Area
          extended byorg.apache.fop.layout.BodyAreaContainer

public class BodyAreaContainer
extends Area


Field Summary
 
Fields inherited from class org.apache.fop.layout.Area
allocationWidth, areaClass, background, bp, children, contentRectangleWidth, currentHeight, foCreator, fontState, generatedBy, isFirst, isLast, maxHeight, page, tableCellXOffset
 
Fields inherited from class org.apache.fop.layout.Box
areaTree, parent
 
Constructor Summary
BodyAreaContainer(FontState fontState, int xPosition, int yPosition, int allocationWidth, int maxHeight, int position, int columnCount, int columnGap)
           
 
Method Summary
 void adjustFootnoteArea()
           
 AreaContainer getBeforeFloatReferenceArea()
           
 AreaContainer getCurrentColumnArea()
           
 AreaContainer getFootnoteReferenceArea()
           
 int getFootnoteState()
           
 IDReferences getIDReferences()
           
 AreaContainer getMainReferenceArea()
           
 AreaContainer getNextArea(FObj fo)
          Depending on the column-count of the next FO, determine whether a new span area needs to be constructed or not, and return the appropriate ColumnArea.
 int getPosition()
           
 int getRemainingHeight()
          Determine remaining height for new span area.
 int getXPosition()
           
 int getYPosition()
           
 boolean isBalancingRequired(FObj fo)
          This almost does what getNewArea() does, without actually returning an area.
 boolean isLastColumn()
          Used in Flow when layout returns incomplete.
 boolean isNewSpanArea()
          This variable is unset by getNextArea(), is set by addSpanArea(), and may be set by resetSpanArea().
 boolean needsFootnoteAdjusting()
           
 void render(Renderer renderer)
           
protected static void resetMaxHeight(Area ar, int change)
           
 void resetSpanArea()
          This is where the balancing algorithm lives, or gets called.
 void setIDReferences(IDReferences idReferences)
           
 void setXPosition(int value)
           
 void setYPosition(int value)
           
 
Methods inherited from class org.apache.fop.layout.Area
addChild, addChildAtStart, addDisplaySpace, addInlineSpace, end, getAbsoluteHeight, getAllocationWidth, getBackground, getBorderAndPadding, getBorderBottomWidth, getBorderLeftWidth, getBorderRightWidth, getBorderTopWidth, getChildren, getContentHeight, getContentWidth, getfoCreator, getFontInfo, getFontState, getGeneratedBy, getHeight, getMaxHeight, getNearestAncestorAreaContainer, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPage, getParent, getTableCellXOffset, hasChildren, hasNonSpaceChildren, increaseHeight, isFirst, isFirst, isLast, isLast, remove, removeChild, removeChild, setAbsoluteHeight, setAllocationWidth, setBackground, setBorderAndPadding, setGeneratedBy, setHeight, setMaxHeight, setPage, setParent, setTableCellXOffset, spaceLeft, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BodyAreaContainer

public BodyAreaContainer(FontState fontState,
                         int xPosition,
                         int yPosition,
                         int allocationWidth,
                         int maxHeight,
                         int position,
                         int columnCount,
                         int columnGap)
Method Detail

render

public void render(Renderer renderer)
Specified by:
render in class Box

getPosition

public int getPosition()

getXPosition

public int getXPosition()

setXPosition

public void setXPosition(int value)

getYPosition

public int getYPosition()

setYPosition

public void setYPosition(int value)

getMainReferenceArea

public AreaContainer getMainReferenceArea()

getBeforeFloatReferenceArea

public AreaContainer getBeforeFloatReferenceArea()

getFootnoteReferenceArea

public AreaContainer getFootnoteReferenceArea()

setIDReferences

public void setIDReferences(IDReferences idReferences)
Overrides:
setIDReferences in class Area

getIDReferences

public IDReferences getIDReferences()
Overrides:
getIDReferences in class Area

getNextArea

public AreaContainer getNextArea(FObj fo)
                          throws FOPException
Depending on the column-count of the next FO, determine whether a new span area needs to be constructed or not, and return the appropriate ColumnArea. The next cut of this method should also inspect the FO to see whether the area to be returned ought not to be the footnote or before-float reference area.

Parameters:
fo - The next formatting object
Returns:
the next column area (possibly the current one)
Throws:
FOPException

isBalancingRequired

public boolean isBalancingRequired(FObj fo)
This almost does what getNewArea() does, without actually returning an area. These 2 methods can be reworked.

Parameters:
fo - The next formatting object
Returns:
boolean True if we need to balance.

resetSpanArea

public void resetSpanArea()
This is where the balancing algorithm lives, or gets called. Right now it's primitive: get the total content height in all columns, divide by the column count, and add a heuristic safety factor. Then the previous (unbalanced) span area is removed, and a new one added with the computed max height.


getRemainingHeight

public int getRemainingHeight()
Determine remaining height for new span area. Needs to be modified for footnote and before-float reference areas when those are supported.

Returns:
int The remaining available height in millipoints.

isLastColumn

public boolean isLastColumn()
Used in Flow when layout returns incomplete.

Returns:
boolean Is this the last column in this span?

isNewSpanArea

public boolean isNewSpanArea()
This variable is unset by getNextArea(), is set by addSpanArea(), and may be set by resetSpanArea().

Returns:
boolean Is the span area new or not?

getCurrentColumnArea

public AreaContainer getCurrentColumnArea()

getFootnoteState

public int getFootnoteState()

needsFootnoteAdjusting

public boolean needsFootnoteAdjusting()

adjustFootnoteArea

public void adjustFootnoteArea()

resetMaxHeight

protected static void resetMaxHeight(Area ar,
                                     int change)


Copyright © 1999-2003 Apache Software Foundation. All Rights Reserved.