Class AbstractGraphicsLayoutManager

All Implemented Interfaces:
PercentBaseContext, Constants, InlineLevelLayoutManager, LayoutManager
Direct Known Subclasses:
ExternalGraphicLayoutManager, InstreamForeignObjectLM

public abstract class AbstractGraphicsLayoutManager extends LeafNodeLayoutManager
LayoutManager handling the common tasks for the fo:instream-foreign-object and fo:external-graphics formatting objects
  • Constructor Details

    • AbstractGraphicsLayoutManager

      public AbstractGraphicsLayoutManager(AbstractGraphics node)
      Constructor.
      Parameters:
      node - the formatting object that creates this area
  • Method Details

    • getNextKnuthElements

      public List getNextKnuthElements(LayoutContext context, int alignment)
      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 LeafNodeLayoutManager
      Parameters:
      context - the LayoutContext used to store layout information
      alignment - the desired text alignment
      Returns:
      the list of KnuthElements
    • getEffectiveArea

      protected InlineArea getEffectiveArea(LayoutContext layoutContext)
      Overrides:
      getEffectiveArea in class LeafNodeLayoutManager
      Returns:
      the effective area to be added to the area tree. Normally, this is simply "curArea" but in the case of page-number(-citation) curArea is cloned, updated and returned.
    • makeAlignmentContext

      protected AlignmentContext makeAlignmentContext(LayoutContext context)
      Creates a new alignment context or returns the current alignment context. This is used for vertical alignment. Subclasses should override this if necessary.
      Overrides:
      makeAlignmentContext in class LeafNodeLayoutManager
      Parameters:
      context - the layout context used
      Returns:
      the appropriate alignment context
    • getChildArea

      protected abstract Area getChildArea()
      Returns the image of foreign object area to be put into the viewport.
      Returns:
      the appropriate area
    • getBaseLength

      public int getBaseLength(int lengthBase, FObj fobj)
      Returns the base length for the given length base. Length base should be one of the constants defined in LengthBase.
      Specified by:
      getBaseLength in interface PercentBaseContext
      Overrides:
      getBaseLength in class AbstractBaseLayoutManager
      Parameters:
      lengthBase - Indicates which type of the base length value is to be returned
      fobj - The FO object against which the percentage should be evaluated
      Returns:
      The base length value of the given kind