org.apache.fop.layoutmgr

Interface LayoutManager

All Superinterfaces:
PercentBaseContext
Known Subinterfaces:
BlockLevelLayoutManager, InlineLevelLayoutManager
Known Implementing Classes:
AbstractBaseLayoutManager, AbstractGraphicsLayoutManager, AbstractLayoutManager, AbstractPageNumberCitationLayoutManager, AbstractPageSequenceLayoutManager, BasicLinkLayoutManager, BidiLayoutManager, BlockContainerLayoutManager, BlockLayoutManager, BlockStackingLayoutManager, CharacterLayoutManager, ContentLayoutManager, ExternalDocumentLayoutManager, ExternalGraphicLayoutManager, FlowLayoutManager, FootnoteBodyLayoutManager, FootnoteLayoutManager, ICLayoutManager, InlineLayoutManager, InlineStackingLayoutManager, InstreamForeignObjectLM, LeaderLayoutManager, LeafNodeLayoutManager, LineLayoutManager, ListBlockLayoutManager, ListItemContentLayoutManager, ListItemLayoutManager, PageNumberCitationLastLayoutManager, PageNumberCitationLayoutManager, PageNumberLayoutManager, PageSequenceLayoutManager, StaticContentLayoutManager, TableAndCaptionLayoutManager, TableCaptionLayoutManager, TableCellLayoutManager, TableLayoutManager, TextLayoutManager, WrapperLayoutManager

public interface LayoutManager
extends PercentBaseContext

The interface for all LayoutManagers.

Method Summary

void
addAreas(PositionIterator posIter, LayoutContext context)
Tell the layout manager to add all the child areas implied by Position objects which will be returned by the Iterator.
void
addChildArea(Area childArea)
Add the area as a child of the current area.
void
addChildLM(LayoutManager lm)
Add the LM in the argument to the list of child LMs; set this LM as the parent; initialize the LM.
void
addChildLMs(List newLMs)
Add the LMs in the argument to the list of child LMs;
boolean
createNextChildLMs(int pos)
Create more child LMs of the parent, up to child LM index pos
LinkedList
getChangedKnuthElements(List oldList, int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM, after changes have been applied In the context of line breaking, this method is called after hyphenation has been performed, in order to receive the sequence of elements representing the text together with all possibile hyphenation points.
List
getChildLMs()
int
getContentAreaBPD()
Returns the BPD of the content area
int
getContentAreaIPD()
Returns the IPD of the content area
FObj
getFObj()
Returns the fo this layout manager is associated with.
boolean
getGeneratesBlockArea()
Returns an indication if the layout manager generates a block area.
boolean
getGeneratesLineArea()
Returns an indication if the layout manager generates a line area.
boolean
getGeneratesReferenceArea()
Returns an indication if the layout manager generates a reference area.
LinkedList
getNextKnuthElements(LayoutContext context, int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM
PageSequenceLayoutManager
getPSLM()
Get the active PageSequenceLayoutManager instance for this layout process.
LayoutManager
getParent()
Get the parent layout manager.
Area
getParentArea(Area childArea)
Get the parent area for an area.
void
initialize()
initialize the layout manager.
boolean
isFinished()
Return a value indicating whether this LayoutManager has laid out all its content (or generated BreakPossibilities for all content.)
Position
notifyPos(Position pos)
Adds a Position to the Position participating in the first|last determination by assigning it a unique position index.
void
setFinished(boolean isFinished)
Set a flag indicating whether the LayoutManager has laid out all its content.
void
setParent(LayoutManager lm)
Set the parent layout manager.

Methods inherited from interface org.apache.fop.datatypes.PercentBaseContext

getBaseLength

Method Details

addAreas

public void addAreas(PositionIterator posIter,
                     LayoutContext context)
Tell the layout manager to add all the child areas implied by Position objects which will be returned by the Iterator.
Parameters:
posIter - the position iterator
context - the context

addChildArea

public void addChildArea(Area childArea)
Add the area as a child of the current area. This is called by child layout managers to add their areas as children of the current area.
Parameters:
childArea - the child area to add

addChildLM

public void addChildLM(LayoutManager lm)
Add the LM in the argument to the list of child LMs; set this LM as the parent; initialize the LM.
Parameters:
lm - the LM to be added

addChildLMs

public void addChildLMs(List newLMs)
Add the LMs in the argument to the list of child LMs;
Parameters:
newLMs - the list of LMs to be added

createNextChildLMs

public boolean createNextChildLMs(int pos)
Create more child LMs of the parent, up to child LM index pos
Parameters:
pos - index up to which child LMs are requested
Returns:
true if requested index does exist

getChangedKnuthElements

public LinkedList getChangedKnuthElements(List oldList,
                                          int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM, after changes have been applied In the context of line breaking, this method is called after hyphenation has been performed, in order to receive the sequence of elements representing the text together with all possibile hyphenation points. For example, if the text "representation" originates a single box element when getNextKnuthElements() is called, it will be now split in syllables (rep-re-sen-ta-tion) each one originating a box and divided by additional elements allowing a line break. In the context of page breaking, this method is called only if the pages need to be "vertically justified" modifying (also) the quantity of lines created by the paragraphs, and after a first page breaking has been performed. According to the result of the first page breaking, each paragraph now knows how many lines it must create (among the existing layout possibilities) and has to create a sequence of elements representing this layout; in particular, each box, representing a line, will contain a LineBreakPositions that will be used in the addAreas() phase. LMs having children look at the old list of elements in order to know which ones they must get the new elements from, as break conditions of preserved linefeeds can divide children into smaller groups (page sequences or paragraphs). LMs having no children can simply return the old elements if they have nothing to change. Inline LMs need to know the text alignment because it affects the elements representing feasible breaks between syllables.
Parameters:
oldList - the elements to replace
alignment - the desired text alignment
Returns:
the updated list of KnuthElements

getChildLMs

public List getChildLMs()
Returns:
the list of child LMs

getContentAreaBPD

public int getContentAreaBPD()
Returns the BPD of the content area
Returns:
the BPD of the content area

getContentAreaIPD

public int getContentAreaIPD()
Returns the IPD of the content area
Returns:
the IPD of the content area

getFObj

public FObj getFObj()
Returns the fo this layout manager is associated with.
Returns:
The fo for this layout manager or null.

getGeneratesBlockArea

public boolean getGeneratesBlockArea()
Returns an indication if the layout manager generates a block area.
Returns:
True if the layout manager generates a block area

getGeneratesLineArea

public boolean getGeneratesLineArea()
Returns an indication if the layout manager generates a line area.
Returns:
True if the layout manager generates a line area

getGeneratesReferenceArea

public boolean getGeneratesReferenceArea()
Returns an indication if the layout manager generates a reference area.
Returns:
True if the layout manager generates a reference area

getNextKnuthElements

public LinkedList getNextKnuthElements(LayoutContext context,
                                       int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM
Parameters:
context - the LayoutContext used to store layout information
alignment - the desired text alignement
Returns:
the list of KnuthElements

getPSLM

public PageSequenceLayoutManager getPSLM()
Get the active PageSequenceLayoutManager instance for this layout process.
Returns:
the PageSequenceLayoutManager

getParent

public LayoutManager getParent()
Get the parent layout manager.
Returns:
the parent layout manager.

getParentArea

public Area getParentArea(Area childArea)
Get the parent area for an area. This should get the parent depending on the class of the area passed in.
Parameters:
childArea - the child area to get the parent for
Returns:
the parent Area

initialize

public void initialize()
initialize the layout manager. Allows each layout manager to calculate often used values.

isFinished

public boolean isFinished()
Return a value indicating whether this LayoutManager has laid out all its content (or generated BreakPossibilities for all content.)
Returns:
true if this layout manager is finished

notifyPos

public Position notifyPos(Position pos)
Adds a Position to the Position participating in the first|last determination by assigning it a unique position index.
Parameters:
pos - the Position
Returns:
the same Position but with a position index

setFinished

public void setFinished(boolean isFinished)
Set a flag indicating whether the LayoutManager has laid out all its content. This is generally called by the LM itself, but can be called by a parentLM when backtracking.
Parameters:
isFinished - the value to set the finished flag to

setParent

public void setParent(LayoutManager lm)
Set the parent layout manager. The parent layout manager is required for adding areas.
Parameters:
lm - the parent layout manager

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.