BodyRegion (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.area

## Class BodyRegion

- java.lang.Object
- - org.apache.fop.area.AreaTreeObject
  - - org.apache.fop.area.Area
    - - org.apache.fop.area.RegionReference
      - - org.apache.fop.area.BodyRegion

- All Implemented Interfaces:
    Serializable, Cloneable

      public class BodyRegion
      extends RegionReference

  This class is a container for the areas that may be generated by an fo:region-body. It extends the RegionReference that is used directly by the other region classes. See fo:region-body definition in the XSL Rec for more information.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.apache.fop.area.RegionReference

      `regionViewport`

    - ### Fields inherited from class org.apache.fop.area.Area

      `bidiLevel, bpd, CLASS_ABSOLUTE, CLASS_BEFORE_FLOAT, CLASS_FIXED, CLASS_FOOTNOTE, CLASS_MAX, CLASS_NORMAL, CLASS_SIDE_FLOAT, effectiveIPD, ipd, log, ORIENT_0, ORIENT_180, ORIENT_270, ORIENT_90, traits`

    - ### Fields inherited from class org.apache.fop.area.AreaTreeObject

      `extensionAttachments, foreignAttributes`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BodyRegion(int regionClass, String regionName, RegionViewport parent, int columnCount, int columnGap)` Constructor which can read traits directly from an fo:region-body formatting object.
    `BodyRegion(RegionBody rb, RegionViewport parent)` Constructor which can read traits directly from an fo:region-body formatting object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()`
    `BeforeFloat` | `getBeforeFloat()` Get the before float area.
    `int` | `getColumnCount()` Get the number of columns when not spanning
    `int` | `getColumnGap()`
    `int` | `getColumnIPD()`
    `Footnote` | `getFootnote()` Get the footnote area.
    `MainReference` | `getMainReference()` Get the main reference area.
    `int` | `getRemainingBPD()`
    `boolean` | `isEmpty()` indicates whether the main reference area has any child areas added to it
    `void` | `setWritingModeTraits(WritingModeTraitsGetter wmtg)` Sets the writing mode traits for the main reference area of this body region area.

    - ### Methods inherited from class org.apache.fop.area.RegionReference

      `addBlock, addChildArea, getBlocks, getCTM, getRegionClass, getRegionName, getRegionViewport, setCTM, toString`

    - ### Methods inherited from class org.apache.fop.area.Area

      `activateEffectiveIPD, addTrait, getAllocBPD, getAllocIPD, getAreaClass, getBidiLevel, getBorderAndPaddingWidthAfter, getBorderAndPaddingWidthBefore, getBorderAndPaddingWidthEnd, getBorderAndPaddingWidthStart, getBPD, getChangeBarList, getEffectiveAllocIPD, getEffectiveIPD, getIPD, getSpaceAfter, getSpaceBefore, getSpaceEnd, getSpaceStart, getTrait, getTraitAsBoolean, getTraitAsInteger, getTraits, hasTrait, hasTraits, isFromFootnote, resetBidiLevel, setAreaClass, setBidiLevel, setBPD, setChangeBarList, setFromFootnote, setIPD, setTraits`

    - ### Methods inherited from class org.apache.fop.area.AreaTreeObject

      `addExtensionAttachment, getExtensionAttachments, getForeignAttributes, getForeignAttributeValue, hasExtensionAttachments, setExtensionAttachments, setForeignAttribute, setForeignAttributes`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BodyRegion

          public BodyRegion(RegionBody rb,
                            RegionViewport parent)

      Constructor which can read traits directly from an fo:region-body formatting object.
      Parameters:
        `rb` - the region-body FO node
        `parent` - the parent region viewport

    - #### BodyRegion

          public BodyRegion(int regionClass,
                            String regionName,
                            RegionViewport parent,
                            int columnCount,
                            int columnGap)

      Constructor which can read traits directly from an fo:region-body formatting object.
      Parameters:
        `regionClass` - the region class (as returned by Region.getNameId())
        `regionName` - the name of the region (as returned by Region.getRegionName())
        `parent` - the parent region viewport
        `columnCount` - the number of columns
        `columnGap` - the gap between columns

  - ### Method Detail

    - #### getColumnCount

          public int getColumnCount()

      Get the number of columns when not spanning
      Returns:
        the number of columns

    - #### getColumnGap

          public int getColumnGap()

      Returns:
        the column-gap value

    - #### getColumnIPD

          public int getColumnIPD()

    - #### getMainReference

          public MainReference getMainReference()

      Get the main reference area.
      Returns:
        the main reference area

    - #### isEmpty

          public boolean isEmpty()

      indicates whether the main reference area has any child areas added to it
      Overrides:
        `isEmpty` in class `RegionReference`
      Returns:
        whether the main reference area has any child areas added to it

    - #### getBeforeFloat

          public BeforeFloat getBeforeFloat()

      Get the before float area.
      Returns:
        the before float area

    - #### getFootnote

          public Footnote getFootnote()

      Get the footnote area.
      Returns:
        the footnote area

    - #### getRemainingBPD

          public int getRemainingBPD()

      Returns:
        the available BPD in the main reference area after the previous span reference areas are subtracted.

    - #### setWritingModeTraits

          public void setWritingModeTraits(WritingModeTraitsGetter wmtg)

      Sets the writing mode traits for the main reference area of this body region area.
      Overrides:
        `setWritingModeTraits` in class `Area`
      Parameters:
        `wmtg` - a WM traits getter

    - #### clone

          public Object clone()
                       throws CloneNotSupportedException

      Overrides:
        `clone` in class `RegionReference`
      Throws:
        `CloneNotSupportedException`

Copyright © 2025 Apache Software Foundation. All rights reserved.