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

org.apache.fop.traits

## Class WritingModeTraits

- java.lang.Object
- - org.apache.fop.traits.WritingModeTraits

- All Implemented Interfaces:
    WritingModeTraitsGetter, WritingModeTraitsSetter

      public class WritingModeTraits
      extends Object
      implements WritingModeTraitsSetter

  This class provides a reusable implementation of the WritingModeTraitsSetter interface.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WritingModeTraits()` Default writing mode traits constructor.
    `WritingModeTraits(WritingMode writingMode, boolean explicit)` Construct writing mode traits using the specified writing mode.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assignWritingModeTraits(WritingMode writingMode, boolean explicit)` Collectivelly assign values to all writing mode traits based upon a specific writing mode.
    `Direction` | `getBlockProgressionDirection()`
    `Direction` | `getColumnProgressionDirection()`
    `boolean` | `getExplicitWritingMode()`
    `Direction` | `getInlineProgressionDirection()`
    `Direction` | `getRowProgressionDirection()`
    `Direction` | `getShiftDirection()`
    `WritingMode` | `getWritingMode()`
    `static WritingModeTraitsGetter` | `getWritingModeTraitsGetter(FONode fn)` Helper function to find the writing mode traits getter (if any) that applies for a given FO node.
    `void` | `setBlockProgressionDirection(Direction direction)` Set value of block-progression-direction trait.
    `void` | `setColumnProgressionDirection(Direction direction)` Set value of column-progression-direction trait.
    `void` | `setInlineProgressionDirection(Direction direction)` Set value of inline-progression-direction trait.
    `void` | `setRowProgressionDirection(Direction direction)` Set value of row-progression-direction trait.
    `void` | `setShiftDirection(Direction direction)` Set value of shift-direction trait.
    `void` | `setWritingMode(WritingMode writingMode, boolean explicit)` Set value of writing-mode trait.

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

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

- - ### Constructor Detail

    - #### WritingModeTraits

          public WritingModeTraits()

      Default writing mode traits constructor.

    - #### WritingModeTraits

          public WritingModeTraits(WritingMode writingMode,
                                   boolean explicit)

      Construct writing mode traits using the specified writing mode.
      Parameters:
        `writingMode` - a writing mode traits object

  - ### Method Detail

    - #### getInlineProgressionDirection

          public Direction getInlineProgressionDirection()

      Specified by:
        `getInlineProgressionDirection` in interface `WritingModeTraitsGetter`
      Returns:
        the "inline-progression-direction" trait.

    - #### setInlineProgressionDirection

          public void setInlineProgressionDirection(Direction direction)

      Description copied from interface: `WritingModeTraitsSetter`
      Set value of inline-progression-direction trait.
      Specified by:
        `setInlineProgressionDirection` in interface `WritingModeTraitsSetter`
      Parameters:
        `direction` - the "inline-progression-direction" trait.

    - #### getBlockProgressionDirection

          public Direction getBlockProgressionDirection()

      Specified by:
        `getBlockProgressionDirection` in interface `WritingModeTraitsGetter`
      Returns:
        the "block-progression-direction" trait.

    - #### setBlockProgressionDirection

          public void setBlockProgressionDirection(Direction direction)

      Description copied from interface: `WritingModeTraitsSetter`
      Set value of block-progression-direction trait.
      Specified by:
        `setBlockProgressionDirection` in interface `WritingModeTraitsSetter`
      Parameters:
        `direction` - the "block-progression-direction" trait.

    - #### getColumnProgressionDirection

          public Direction getColumnProgressionDirection()

      Specified by:
        `getColumnProgressionDirection` in interface `WritingModeTraitsGetter`
      Returns:
        the "column-progression-direction" trait.

    - #### setColumnProgressionDirection

          public void setColumnProgressionDirection(Direction direction)

      Description copied from interface: `WritingModeTraitsSetter`
      Set value of column-progression-direction trait.
      Specified by:
        `setColumnProgressionDirection` in interface `WritingModeTraitsSetter`
      Parameters:
        `direction` - the "column-progression-direction" trait.

    - #### getRowProgressionDirection

          public Direction getRowProgressionDirection()

      Specified by:
        `getRowProgressionDirection` in interface `WritingModeTraitsGetter`
      Returns:
        the "row-progression-direction" trait.

    - #### setRowProgressionDirection

          public void setRowProgressionDirection(Direction direction)

      Description copied from interface: `WritingModeTraitsSetter`
      Set value of row-progression-direction trait.
      Specified by:
        `setRowProgressionDirection` in interface `WritingModeTraitsSetter`
      Parameters:
        `direction` - the "row-progression-direction" trait.

    - #### getShiftDirection

          public Direction getShiftDirection()

      Specified by:
        `getShiftDirection` in interface `WritingModeTraitsGetter`
      Returns:
        the "shift-direction" trait.

    - #### setShiftDirection

          public void setShiftDirection(Direction direction)

      Description copied from interface: `WritingModeTraitsSetter`
      Set value of shift-direction trait.
      Specified by:
        `setShiftDirection` in interface `WritingModeTraitsSetter`
      Parameters:
        `direction` - the "shift-direction" trait.

    - #### getWritingMode

          public WritingMode getWritingMode()

      Specified by:
        `getWritingMode` in interface `WritingModeTraitsGetter`
      Returns:
        the "writing-mode" trait.

    - #### getExplicitWritingMode

          public boolean getExplicitWritingMode()

      Specified by:
        `getExplicitWritingMode` in interface `WritingModeTraitsGetter`
      Returns:
        the "explicit-writing-mode" trait.

    - #### setWritingMode

          public void setWritingMode(WritingMode writingMode,
                                     boolean explicit)

      Description copied from interface: `WritingModeTraitsSetter`
      Set value of writing-mode trait.
      Specified by:
        `setWritingMode` in interface `WritingModeTraitsSetter`
      Parameters:
        `writingMode` - the "writing-mode" trait.

    - #### assignWritingModeTraits

          public void assignWritingModeTraits(WritingMode writingMode,
                                              boolean explicit)

      Description copied from interface: `WritingModeTraitsSetter`
      Collectivelly assign values to all writing mode traits based upon a specific writing mode.
      Specified by:
        `assignWritingModeTraits` in interface `WritingModeTraitsSetter`
      Parameters:
        `writingMode` - the "writing-mode" trait.
        `explicit` - true if writing mode explicitly specified

    - #### getWritingModeTraitsGetter

          public static WritingModeTraitsGetter getWritingModeTraitsGetter(FONode fn)

      Helper function to find the writing mode traits getter (if any) that applies for a given FO node.
      Parameters:
        `fn` - the node to start searching from
      Returns:
        the applicable writing mode traits getter, or null if none applies

Copyright © 2025 Apache Software Foundation. All rights reserved.