org.apache.fop.afp.modca

## Class PresentationTextObject

- java.lang.Object
- - org.apache.fop.afp.modca.AbstractAFPObject
  - - org.apache.fop.afp.modca.AbstractStructuredObject
    - - org.apache.fop.afp.modca.AbstractTripletStructuredObject
      - - org.apache.fop.afp.modca.AbstractNamedAFPObject
        - - org.apache.fop.afp.modca.PresentationTextObject

- All Implemented Interfaces:
    Streamable

      public class PresentationTextObject
      extends AbstractNamedAFPObject

  The Presentation Text object is the data object used in document processing environments for representing text which has been prepared for presentation. Text, as used here, means an ordered string of characters, such as graphic symbols, numbers, and letters, that are suitable for the specific purpose of representing coherent information. Text which has been prepared for presentation has been reduced to a primitive form through explicit specification of the characters and their placement in the presentation space. Control sequences which designate specific control functions may be embedded within the text. These functions extend the primitive form by applying specific characteristics to the text when it is presented. The collection of the graphic characters and control codes is called Presentation Text, and the object that contains the Presentation Text is called the PresentationText object.

  The content for this object can be created using `PtocaBuilder`.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `AbstractAFPObject.Category, AbstractAFPObject.Type`

  - ### Field Summary

    - ### Fields inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject

      `name`

    - ### Fields inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject

      `triplets`

    - ### Fields inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `LOG, SF_CLASS, SF_HEADER_LENGTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PresentationTextObject(String name)` Construct a new PresentationTextObject for the specified name argument, the name should be an 8 character identifier.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `createControlSequences(PtocaProducer producer)` Creates a chain of control sequences using a producer.
    `boolean` | `createLineData(AFPLineDataInfo lineDataInfo)` Drawing of lines using the starting and ending coordinates, thickness and orientation arguments.
    `void` | `createTextData(AFPTextDataInfo textDataInfo)` Create the presentation text data for the byte array of data.
    `void` | `endControlSequence()` A control sequence is a sequence of bytes that specifies a control function.
    `Integer` | `getBytesAvailable()`
    `String` | `toString()`
    `protected void` | `writeContent(OutputStream os)` Helper method to write the contents of the Object.
    `protected void` | `writeEnd(OutputStream os)` Helper method to write the end of the Object.
    `protected void` | `writeStart(OutputStream os)` Helper method to write the start of the Object.

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject

      `copySF, getName, getNameBytes, getNameLength, setName`

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject

      `addTriplet, addTriplets, getFullyQualifiedName, getTripletDataLength, getTriplets, hasTriplet, hasTriplets, setComment, setFullyQualifiedName, setFullyQualifiedName, setObjectClassification, writeTriplets`

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractStructuredObject

      `writeToStream`

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `copySF, truncate, writeChunksToStream, writeObjects`

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

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

- - ### Constructor Detail

    - #### PresentationTextObject

          public PresentationTextObject(String name)

      Construct a new PresentationTextObject for the specified name argument, the name should be an 8 character identifier.
      Parameters:
        `name` - the name of this presentation object

  - ### Method Detail

    - #### createTextData

          public void createTextData(AFPTextDataInfo textDataInfo)
                              throws UnsupportedEncodingException

      Create the presentation text data for the byte array of data.
      Parameters:
        `textDataInfo` - The afp text data
      Throws:
        `UnsupportedEncodingException` - thrown if character encoding is not supported

    - #### createControlSequences

          public boolean createControlSequences(PtocaProducer producer)
                                         throws UnsupportedEncodingException

      Creates a chain of control sequences using a producer.
      Parameters:
        `producer` - the producer
      Throws:
        `UnsupportedEncodingException` - thrown if character encoding is not supported

    - #### createLineData

          public boolean createLineData(AFPLineDataInfo lineDataInfo)

      Drawing of lines using the starting and ending coordinates, thickness and orientation arguments.
      Parameters:
        `lineDataInfo` - the line data information.

    - #### writeStart

          protected void writeStart(OutputStream os)
                             throws IOException

      Helper method to write the start of the Object.
      Overrides:
        `writeStart` in class `AbstractStructuredObject`
      Parameters:
        `os` - The stream to write to
      Throws:
        `IOException` - throws an I/O exception if one occurred

    - #### writeContent

          protected void writeContent(OutputStream os)
                               throws IOException

      Helper method to write the contents of the Object.
      Overrides:
        `writeContent` in class `AbstractStructuredObject`
      Parameters:
        `os` - The stream to write to
      Throws:
        `IOException` - throws an I/O exception if one occurred

    - #### writeEnd

          protected void writeEnd(OutputStream os)
                           throws IOException

      Helper method to write the end of the Object.
      Overrides:
        `writeEnd` in class `AbstractStructuredObject`
      Parameters:
        `os` - The stream to write to
      Throws:
        `IOException` - an I/O exception if one occurred

    - #### endControlSequence

          public void endControlSequence()

      A control sequence is a sequence of bytes that specifies a control function. A control sequence consists of a control sequence introducer and zero or more parameters. The control sequence can extend multiple presentation text data objects, but must eventually be terminated. This method terminates the control sequence.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractNamedAFPObject`

    - #### getBytesAvailable

          public Integer getBytesAvailable()

Copyright © 2023 Apache Software Foundation. All rights reserved.