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

org.apache.fop.area

## Class Block

- java.lang.Object
- - org.apache.fop.area.AreaTreeObject
  - - org.apache.fop.area.Area
    - - org.apache.fop.area.BlockParent
      - - org.apache.fop.area.Block

- All Implemented Interfaces:
    Serializable, Cloneable
  Direct Known Subclasses:
    BlockViewport, SideFloat

      public class Block
      extends BlockParent

  This is the block area class. It holds child block areas such as other blocks or lines.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ABSOLUTE` Relative to the block parent but not effecting the stacking Used for block-container, tables and lists.
    `protected boolean` | `allowBPDUpdate` if true, allow BPD update
    `static int` | `FIXED` Relative to a viewport/page but not effecting the stacking Used for block-container.
    `static int` | `RELATIVE` Placed relative to the flow position.
    `static int` | `STACK` Normally stacked with other blocks.

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

      `children, xOffset, yOffset`

    - ### 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
    `Block()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activateEffectiveIPD()`
    `void` | `addBlock(Block block)` Add the block to this block area.
    `void` | `addBlock(Block block, boolean autoHeight)` Add the block to this block area.
    `void` | `addLineArea(LineArea line)` Add the line area to this block area.
    `int` | `getEffectiveIPD()`
    `int` | `getEndIndent()`
    `Locale` | `getLocale()` Returns the language information for the FO that generated this area.
    `String` | `getLocation()` Returns the location in the source XML of the FO that generated this area.
    `int` | `getPositioning()` Get the positioning of this area.
    `int` | `getStartIndent()`
    `boolean` | `isStacked()` Indicates whether this block is stacked, rather than absolutely positioned.
    `void` | `setLocale(Locale locale)` Sets the language information coming from the FO that generated this area.
    `void` | `setLocation(String location)` Sets the location in the source XML of the FO that generated this area.
    `void` | `setPositioning(int pos)` Set the positioning of this area.

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

      `addChildArea, getChildAreas, getXOffset, getYOffset, isEmpty, setXOffset, setYOffset`

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

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

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

- - ### Field Detail

    - #### STACK

          public static final int STACK

      Normally stacked with other blocks.
      See Also:
        Constant Field Values

    - #### RELATIVE

          public static final int RELATIVE

      Placed relative to the flow position. This effects the flow placement of stacking normally.
      See Also:
        Constant Field Values

    - #### ABSOLUTE

          public static final int ABSOLUTE

      Relative to the block parent but not effecting the stacking Used for block-container, tables and lists.
      See Also:
        Constant Field Values

    - #### FIXED

          public static final int FIXED

      Relative to a viewport/page but not effecting the stacking Used for block-container.
      See Also:
        Constant Field Values

    - #### allowBPDUpdate

          protected transient boolean allowBPDUpdate

      if true, allow BPD update

  - ### Constructor Detail

    - #### Block

          public Block()

  - ### Method Detail

    - #### addBlock

          public void addBlock(Block block)

      Add the block to this block area.
      Overrides:
        `addBlock` in class `BlockParent`
      Parameters:
        `block` - the block area to add

    - #### addBlock

          public void addBlock(Block block,
                               boolean autoHeight)

      Add the block to this block area.
      Parameters:
        `block` - the block area to add
        `autoHeight` - increase the height of the block.

    - #### addLineArea

          public void addLineArea(LineArea line)

      Add the line area to this block area.
      Parameters:
        `line` - the line area to add

    - #### setPositioning

          public void setPositioning(int pos)

      Set the positioning of this area.
      Parameters:
        `pos` - the positioning to use when rendering this area

    - #### getPositioning

          public int getPositioning()

      Get the positioning of this area.
      Returns:
        the positioning to use when rendering this area

    - #### isStacked

          public boolean isStacked()

      Indicates whether this block is stacked, rather than absolutely positioned.
      Returns:
        true if it is stacked

    - #### getStartIndent

          public int getStartIndent()

      Returns:
        the start-indent trait

    - #### getEndIndent

          public int getEndIndent()

      Returns:
        the end-indent trait

    - #### setLocale

          public void setLocale(Locale locale)

      Sets the language information coming from the FO that generated this area.

    - #### getLocale

          public Locale getLocale()

      Returns the language information for the FO that generated this area.

    - #### setLocation

          public void setLocation(String location)

      Sets the location in the source XML of the FO that generated this area.
      Parameters:
        `location` - the line and column location

    - #### getLocation

          public String getLocation()

      Returns the location in the source XML of the FO that generated this area.
      Returns:
        the line and column location, `null` if that information is not available

    - #### getEffectiveIPD

          public int getEffectiveIPD()

      Overrides:
        `getEffectiveIPD` in class `BlockParent`

    - #### activateEffectiveIPD

          public void activateEffectiveIPD()

      Overrides:
        `activateEffectiveIPD` in class `BlockParent`

Copyright © 2025 Apache Software Foundation. All rights reserved.