Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.fop.layoutmgr
Interface LayoutManager

All Superinterfaces:
  PercentBaseContext

All Known Subinterfaces:
  BlockLevelLayoutManager, InlineLevelLayoutManager

All Known Implementing Classes:
  AbstractBaseLayoutManager, BlockStackingLayoutManager, ContentLayoutManager, FlowLayoutManager, InlineStackingLayoutManager, LeafNodeLayoutManager, LineLayoutManager, TableCellLayoutManager

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(java.util.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
`java.util.List` | `getChangedKnuthElements(java.util.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 possible hyphenation points.
`java.util.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.
`java.util.List` | `getNextKnuthElements(LayoutContext context, int alignment)` Get a sequence of KnuthElements representing the content of the node assigned to the LM
`java.util.List` | `getNextKnuthElements(LayoutContext context, int alignment, java.util.Stack lmStack, Position positionAtIPDChange, LayoutManager restartAtLM)` Returns an updated list of Knuth elements corresponding to this layout manager, after a change of IPD has been detected.
`LayoutManager` | `getParent()` Get the parent layout manager.
`Area` | `getParentArea(Area childArea)` Get the parent area for an area.
`PageSequenceLayoutManager` | `getPSLM()` Get the active PageSequenceLayoutManager instance for this layout process.
`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.)
`boolean` | `isRestartable()` Returns if this layout manager is able to re-generate its Knuth elements after an IPD change.
`Position` | `notifyPos(Position pos)` Adds a Position to the Position participating in the first|last determination by assigning it a unique position index.
`void` | `reset()` Re-initializes this layout manager in order to re-generate its Knuth elements according to a new IPD value.
`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 Detail

### 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

### getParent

    public LayoutManager getParent()

  Get the parent layout manager.

  Returns:
    the parent layout manager.

### initialize

    public void initialize()

  initialize the layout manager. Allows each layout manager to calculate often used values.

### getPSLM

    public PageSequenceLayoutManager getPSLM()

  Get the active PageSequenceLayoutManager instance for this layout process.

  Returns:
    the PageSequenceLayoutManager

### 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

### 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

### 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

### 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

### 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

### 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

### getChildLMs

    public java.util.List getChildLMs()

  Returns:
    the list of child LMs

### 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(java.util.List newLMs)

  Add the LMs in the argument to the list of child LMs;

  Parameters:
    `newLMs` - the list of LMs to be added

### getNextKnuthElements

    public java.util.List 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 alignment
  Returns:
    the list of KnuthElements

### getChangedKnuthElements

    public java.util.List getChangedKnuthElements(java.util.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 possible 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

### getContentAreaIPD

    public int getContentAreaIPD()

  Returns the IPD of the content area

  Returns:
    the IPD of the content area

### getContentAreaBPD

    public int getContentAreaBPD()

  Returns the BPD of the content area

  Returns:
    the BPD of the content 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

### 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

### getFObj

    public FObj getFObj()

  Returns the fo this layout manager is associated with.

  Returns:
    The fo for this layout manager or null.

### 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

### reset

    public void reset()

  Re-initializes this layout manager in order to re-generate its Knuth elements according to a new IPD value.

### isRestartable

    public boolean isRestartable()

  Returns if this layout manager is able to re-generate its Knuth elements after an IPD change.

  Returns:
    if this layout manager can be restarted after an IPD change

### getNextKnuthElements

    public java.util.List getNextKnuthElements(LayoutContext context,
                                               int alignment,
                                               java.util.Stack lmStack,
                                               Position positionAtIPDChange,
                                               LayoutManager restartAtLM)

  Returns an updated list of Knuth elements corresponding to this layout manager, after a change of IPD has been detected.

  Parameters:
    `context` - the layout context
    `alignment` - the alignment
    `lmStack` - the stack of LMs that are active at the IPD change
    `positionAtIPDChange` - the position corresponding to the element finishing the page before the IPD change
    `restartAtLM` - if not null, the layout manager from which to restart. That is, the IPD change occurs between two block elements and not inside a paragraph
  Returns:
    an updated list of elements, taking the new IPD into account

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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