Class InlineContainerLayoutManager

All Implemented Interfaces:
PercentBaseContext, Constants, InlineLevelLayoutManager, LayoutManager

public class InlineContainerLayoutManager extends AbstractLayoutManager implements InlineLevelLayoutManager
This creates a single inline container area after laying out the child block areas. All footnotes, floats and id areas are maintained for later retrieval.
  • Constructor Details

    • InlineContainerLayoutManager

      public InlineContainerLayoutManager(InlineContainer node)
  • Method Details

    • initialize

      public void initialize()
      Description copied from class: AbstractLayoutManager
      initialize the layout manager. Allows each layout manager to calculate often used values.
      Specified by:
      initialize in interface LayoutManager
      Overrides:
      initialize in class AbstractLayoutManager
    • getNextKnuthElements

      public List<KnuthSequence> getNextKnuthElements(LayoutContext context, int alignment)
      Description copied from class: AbstractLayoutManager
      Get a sequence of KnuthElements representing the content of the node assigned to the LM.
      Specified by:
      getNextKnuthElements in interface LayoutManager
      Overrides:
      getNextKnuthElements in class AbstractLayoutManager
      Parameters:
      context - the LayoutContext used to store layout information
      alignment - the desired text alignment
      Returns:
      the list of KnuthElements
    • makeAlignmentContext

      protected AlignmentContext makeAlignmentContext(LayoutContext context)
    • addAreas

      public void addAreas(PositionIterator posIter, LayoutContext context)
      Description copied from class: AbstractLayoutManager
      Tell the layout manager to add all the child areas implied by Position objects which will be returned by the Iterator.
      Specified by:
      addAreas in interface LayoutManager
      Overrides:
      addAreas in class AbstractLayoutManager
      Parameters:
      posIter - the position iterator
      context - the context
    • getParentArea

      public Area getParentArea(Area childArea)
      Description copied from class: AbstractLayoutManager
      Return an Area which can contain the passed childArea. The childArea may not yet have any content, but it has essential traits set. In general, if the LayoutManager already has an Area it simply returns it. Otherwise, it makes a new Area of the appropriate class. It gets a parent area for its area by calling its parent LM. Finally, based on the dimensions of the parent area, it initializes its own area. This includes setting the content IPD and the maximum BPD.
      Specified by:
      getParentArea in interface LayoutManager
      Overrides:
      getParentArea in class AbstractLayoutManager
      Parameters:
      childArea - the child area for which the parent area is wanted
      Returns:
      the parent area for the given child
    • getContentAreaIPD

      public int getContentAreaIPD()
      Description copied from class: AbstractBaseLayoutManager
      Returns the IPD of the content area NOTE: Should be overridden by subclasses. Default implementation throws an UnsupportedOperationException.
      Specified by:
      getContentAreaIPD in interface LayoutManager
      Overrides:
      getContentAreaIPD in class AbstractBaseLayoutManager
      Returns:
      the IPD of the content area
    • getContentAreaBPD

      public int getContentAreaBPD()
      Description copied from class: AbstractBaseLayoutManager
      Returns the BPD of the content area NOTE: Should be overridden by subclasses. Default implementation throws an UnsupportedOperationException.
      Specified by:
      getContentAreaBPD in interface LayoutManager
      Overrides:
      getContentAreaBPD in class AbstractBaseLayoutManager
      Returns:
      the BPD of the content area
    • addChildArea

      public void addChildArea(Area childArea)
      Description copied from class: AbstractLayoutManager
      Add a child area to the current area. If this causes the maximum dimension of the current area to be exceeded, the parent LM is called to add it.
      Specified by:
      addChildArea in interface LayoutManager
      Overrides:
      addChildArea in class AbstractLayoutManager
      Parameters:
      childArea - the child area to be added
    • handleOverflow

      public boolean handleOverflow(int milliPoints)
    • addALetterSpaceTo

      public List addALetterSpaceTo(List oldList)
      Description copied from interface: InlineLevelLayoutManager
      Tell the LM to modify its data, adding a letter space to the word fragment represented by the given elements, and returning the corrected elements
      Specified by:
      addALetterSpaceTo in interface InlineLevelLayoutManager
      Parameters:
      oldList - the elements which must be given one more letter space
      Returns:
      the new elements replacing the old ones
    • addALetterSpaceTo

      public List addALetterSpaceTo(List oldList, int depth)
      Description copied from interface: InlineLevelLayoutManager
      Tell the LM to modify its data, adding a letter space to the word fragment represented by the given elements, and returning the corrected elements
      Specified by:
      addALetterSpaceTo in interface InlineLevelLayoutManager
      Parameters:
      oldList - the elements which must be given one more letter space
      depth - the depth at which the Positions for this LM in oldList are found
      Returns:
      the new elements replacing the old ones
    • getWordChars

      public String getWordChars(Position pos)
      Description copied from interface: InlineLevelLayoutManager
      Get the word chars corresponding to the given position.
      Specified by:
      getWordChars in interface InlineLevelLayoutManager
      Parameters:
      pos - the position referring to the needed word chars.
      Returns:
      the word chars
    • hyphenate

      public void hyphenate(Position pos, HyphContext hyphContext)
      Description copied from interface: InlineLevelLayoutManager
      Tell the LM to hyphenate a word
      Specified by:
      hyphenate in interface InlineLevelLayoutManager
      Parameters:
      pos - the Position referring to the word
      hyphContext - the HyphContext storing hyphenation information
    • applyChanges

      public boolean applyChanges(List oldList)
      Description copied from interface: InlineLevelLayoutManager
      Tell the LM to apply the changes due to hyphenation
      Specified by:
      applyChanges in interface InlineLevelLayoutManager
      Parameters:
      oldList - the list of the old elements the changes refer to
      Returns:
      true if the LM had to change its data, false otherwise
    • applyChanges

      public boolean applyChanges(List oldList, int depth)
      Description copied from interface: InlineLevelLayoutManager
      Tell the LM to apply the changes due to hyphenation
      Specified by:
      applyChanges in interface InlineLevelLayoutManager
      Parameters:
      oldList - the list of the old elements the changes refer to
      depth - the depth at which the Positions for this LM in oldList are found
      Returns:
      true if the LM had to change its data, false otherwise
    • getChangedKnuthElements

      public List getChangedKnuthElements(List oldList, int alignment, int depth)
      Description copied from interface: InlineLevelLayoutManager
      Get a sequence of KnuthElements representing the content of the node assigned to the LM, after changes have been applied
      Specified by:
      getChangedKnuthElements in interface InlineLevelLayoutManager
      Parameters:
      oldList - the elements to replace
      alignment - the desired text alignment
      depth - the depth at which the Positions for this LM in oldList are found
      Returns:
      the updated list of KnuthElements