org.apache.fop.datatypes

## Class LengthBase

- java.lang.Object
- - org.apache.fop.datatypes.LengthBase

- All Implemented Interfaces:
    PercentBase

      public class LengthBase
      extends Object
      implements PercentBase

  Models a length which can be used as a factor in a percentage length calculation

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ALIGNMENT_ADJUST` constant for a alignment adjust percent-based length
    `static int` | `CONTAINING_BLOCK_HEIGHT` constant for a containing block percent-based length
    `static int` | `CONTAINING_BLOCK_WIDTH` constant for a containing block percent-based length
    `static int` | `CONTAINING_REFAREA_WIDTH` constant for a containing refarea percent-based length
    `static int` | `CUSTOM_BASE` constant for a custom percent-based length
    `protected FObj` | `fobj` The FO for which this property is to be calculated.
    `static int` | `FONTSIZE` constant for a font-size percent-based length
    `static int` | `IMAGE_BACKGROUND_POSITION_HORIZONTAL` constant for a image background position horizontal percent-based length
    `static int` | `IMAGE_BACKGROUND_POSITION_VERTICAL` constant for a image background position vertical percent-based length
    `static int` | `IMAGE_INTRINSIC_HEIGHT` constant for a image intrinsic percent-based length
    `static int` | `IMAGE_INTRINSIC_WIDTH` constant for a image intrinsic percent-based length
    `static int` | `INH_FONTSIZE` constant for an inh font-size percent-based length
    `protected static org.apache.commons.logging.Log` | `log` logging instance
    `static int` | `PARENT_AREA_WIDTH` constant for a containing box percent-based length
    `static int` | `TABLE_UNITS` constant for a table-unit-based length

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LengthBase(PropertyList plist, int baseType)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `Length` | `getBaseLength()`
    `int` | `getBaseLength(PercentBaseContext context)`
    `double` | `getBaseValue()`
    `int` | `getDimension()` Determines whether a numeric property is created or one with a percentage base.
    `int` | `hashCode()`
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### CUSTOM_BASE

          public static final int CUSTOM_BASE

      constant for a custom percent-based length
      See Also:
        Constant Field Values

    - #### FONTSIZE

          public static final int FONTSIZE

      constant for a font-size percent-based length
      See Also:
        Constant Field Values

    - #### INH_FONTSIZE

          public static final int INH_FONTSIZE

      constant for an inh font-size percent-based length
      See Also:
        Constant Field Values

    - #### PARENT_AREA_WIDTH

          public static final int PARENT_AREA_WIDTH

      constant for a containing box percent-based length
      See Also:
        Constant Field Values

    - #### CONTAINING_REFAREA_WIDTH

          public static final int CONTAINING_REFAREA_WIDTH

      constant for a containing refarea percent-based length
      See Also:
        Constant Field Values

    - #### CONTAINING_BLOCK_WIDTH

          public static final int CONTAINING_BLOCK_WIDTH

      constant for a containing block percent-based length
      See Also:
        Constant Field Values

    - #### CONTAINING_BLOCK_HEIGHT

          public static final int CONTAINING_BLOCK_HEIGHT

      constant for a containing block percent-based length
      See Also:
        Constant Field Values

    - #### IMAGE_INTRINSIC_WIDTH

          public static final int IMAGE_INTRINSIC_WIDTH

      constant for a image intrinsic percent-based length
      See Also:
        Constant Field Values

    - #### IMAGE_INTRINSIC_HEIGHT

          public static final int IMAGE_INTRINSIC_HEIGHT

      constant for a image intrinsic percent-based length
      See Also:
        Constant Field Values

    - #### IMAGE_BACKGROUND_POSITION_HORIZONTAL

          public static final int IMAGE_BACKGROUND_POSITION_HORIZONTAL

      constant for a image background position horizontal percent-based length
      See Also:
        Constant Field Values

    - #### IMAGE_BACKGROUND_POSITION_VERTICAL

          public static final int IMAGE_BACKGROUND_POSITION_VERTICAL

      constant for a image background position vertical percent-based length
      See Also:
        Constant Field Values

    - #### TABLE_UNITS

          public static final int TABLE_UNITS

      constant for a table-unit-based length
      See Also:
        Constant Field Values

    - #### ALIGNMENT_ADJUST

          public static final int ALIGNMENT_ADJUST

      constant for a alignment adjust percent-based length
      See Also:
        Constant Field Values

    - #### log

          protected static final org.apache.commons.logging.Log log

      logging instance

    - #### fobj

          protected FObj fobj

      The FO for which this property is to be calculated.

  - ### Constructor Detail

    - #### LengthBase

          public LengthBase(PropertyList plist,
                            int baseType)
                     throws PropertyException

      Constructor
      Parameters:
        `plist` - property list for this
        `baseType` - a constant defining the type of teh percent base
      Throws:
        `PropertyException` - In case an problem occurs while evaluating values

  - ### Method Detail

    - #### getDimension

          public int getDimension()

      Description copied from interface: `PercentBase`
      Determines whether a numeric property is created or one with a percentage base.
      Specified by:
        `getDimension` in interface `PercentBase`
      Returns:
        the dimension of this object (always 1)

    - #### getBaseValue

          public double getBaseValue()

      Specified by:
        `getBaseValue` in interface `PercentBase`
      Returns:
        the base value of this object (always 1.0)

    - #### getBaseLength

          public int getBaseLength(PercentBaseContext context)
                            throws PropertyException

      Specified by:
        `getBaseLength` in interface `PercentBase`
      Parameters:
        `context` - The context for percentage evaluation
      Returns:
        the integer size in millipoints of the object (this will be used as the base to which a percentage will be applied to compute the length of the referencing item)
      Throws:
        `PropertyException` - if a problem occurs during evaluation of this value.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getBaseLength

          public Length getBaseLength()

      Returns:
        the base length as a `Length`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

Copyright © 2025 Apache Software Foundation. All rights reserved.