Overview of the flashx.textLayout.elements package

The model for the Text Layout Framework is defined mainly by the elements package, which includes classes and interfaces that define the data structure that holds the text. The model uses a hierarchical tree to represent text and each node in the tree is an instance of a class in the elements package.

The root node of the tree is always an instance of the TextFlow class. The TextFlow class represents an entire story, which is a collection of text that is treated as one unit, or flow, even if the flow requires more than one column or text container to display. The remaining elements in the hierarchy are loosely based on XHTML elements. For example, the root node can have children of two types, DivElement and ParagraphElement. DivElements and ParagraphElements are similar, but not identical, to the <div /> and <p /> XHTML elements.

DivElements are more narrowly defined than the <div /> XHTML element in that DivElements contain only ParagraphElements and other DivElements whereas the XHTML element can contain a wider variety of elements, including text. ParagraphElements are grouping elements that cannot directly contain text or graphics. ParagraphElements can, however, contain four types of child elements that do directly contain primitive text and graphics:

The following diagram illustrates the node hierarchy in the elements package of the Text Layout Framework:

example TextFlow hierarchy

The abstract base classes FlowElement, FlowGroupElement, and FlowLeafElement define the structure of the tree. All the objects in the tree derive from the FlowElement class. FlowElement objects represent paragraphs, groups of paragraphs and spans of text within paragraphs. The FlowGroupElement class is the base class for classes that can have an array of children. These classes include TextFlow, ParagraphElement, DivElement, and LinkElement. The FlowLeafElement class is the base class for classes at the lowest level of the tree, classes that have no children. These classes include InLineGraphicElement and SpanElement.

The remaining classes in the elements package play supporting roles.



Interfaces
 InterfaceDescription
 IConfigurationRead-only interface to a configuration object.
Classes
 ClassDescription
 BreakElementThe BreakElement class defines a line break, which provides for creating a line break in the text without creating a new paragraph.
 ConfigurationThe Configuration class is a primary point of integration between the Text Layout Framework and an application.
 ContainerFormattedElementContainerFormattedElement is the root class for all container-level block elements, such as DivElement and TextFlow objects.
 DivElementThe DivElement class defines an element for grouping paragraphs (ParagraphElement objects).
 FlowElementThe text in a flow is stored in tree form with the elements of the tree representing logical divisions within the text.
 FlowGroupElementThe FlowGroupElement class is the base class for FlowElement objects that can have an array of children.
 FlowLeafElementBase class for FlowElements that appear at the lowest level of the flow hierarchy.
 InlineGraphicElementThe InlineGraphicElement class handles graphic objects that display inline in the text.
 InlineGraphicElementStatusThe InlineGraphicElementStatus class defines a set of constants for checking the value of InLineGraphicElement.status.
 LinkElementThe LinkElement class defines a link to a URI, which is executed when the user clicks it.
 LinkStateThe LinkState class defines a set of constants for the linkState property of the LinkElement class.
 ParagraphElementThe ParagraphElement class represents a paragraph in the text flow hierarchy.
 ParagraphFormattedElementThe ParagraphFormattedElement is an abstract base class for FlowElement classes that have paragraph properties.
 SpanElementThe SpanElement class represents a run of text that has a single set of formatting attributes applied.
 SpecialCharacterElementThe SpecialCharacterElement class is an abstract base class for elements that represent special characters.
 SubParagraphGroupElementThe SubParagraphGroupElement class groups FlowLeafElements together.
 TabElementThe TabElement class represents a <tab/> in the text flow.
 TCYElementThe TCYElement (Tatechuuyoko - ta-tae-chu-yo-ko) class is a subclass of SubParagraphGroupElement that causes text to draw horizontally within a vertical line.
 TextFlowThe TextFlow class is responsible for managing all the text content of a story.
 TextFlowLineThe TextFlowLine class represents a single line of text in a text flow.
 TextFlowLineLocationThe TextFlowLineLocation class is an enumeration class that defines constants for specifying the location of a line within a paragraph.