Apache Flex 4.16.1 API Reference | All Packages | All Classes | Index | Frames No Frames |
FlowComposerBase

Package | flashx.textLayout.compose
Class | public class FlowComposerBase
Inheritance | FlowComposerBase Object
Subclasses | StandardFlowComposer

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The FlowComposerBase class is the base class for Text Layout Framework flow composer classes, which control the composition of text lines in ContainerController objects.

FlowComposerBase is a utility class that implements methods and properties that are common to several types of flow composer. Application code would not typically instantiate or use this class (unless extending it to create a custom flow composer).

See also

flashx.textLayout.elements.TextFlow.flowComposer

Public Properties

| Property | Defined By
--- | --- | ---
|  | damageAbsoluteStart : int [read-only] The absolute position immediately preceding the first element in the text flow that requires composition and updating. | FlowComposerBase
|  | numLines : int [read-only] The total number of lines composed in the flow. | FlowComposerBase
|  | swfContext : ISWFContext The ISWFContext instance used to make FTE calls as needed. | FlowComposerBase
|  | textFlow : TextFlow [read-only] The TextFlow object to which this flow composer is attached. | FlowComposerBase

Public Methods

| Method | Defined By
--- | --- | ---
|  | FlowComposerBase() Constructor. | FlowComposerBase
|  | damage(startPosition:int, damageLength:int, damageType:String):void Mark lines as damaged and needing a recompose. | FlowComposerBase
|  | findLineAtPosition(absolutePosition:int, preferPrevious:Boolean = false):TextFlowLine Returns the TextFlowLine object containing the content at the specified position. | FlowComposerBase
|  | findLineIndexAtPosition(absolutePosition:int, preferPrevious:Boolean = false):int Returns the sequential line number of the TextFlowLine object that contains the content at the specified position. | FlowComposerBase
|  | getLineAt(index:int):TextFlowLine Returns the line with the specified line number. | FlowComposerBase
|  | isDamaged(absolutePosition:int):Boolean Indicates whether any TextFlowLine objects between the beginning of the flow and the line containing the content at the specified position are marked as damaged. | FlowComposerBase
|  | isPotentiallyDamaged(absolutePosition:int):Boolean Indicates whether any TextFlowLine objects between the beginning of the flow and the line containing the content at the specified position are marked as damaged OR if there are other clues that the textFlow should be rebuilt. | FlowComposerBase
|  | updateLengths(startPosition:int, deltaLength:int):void Update the lengths in the lines to maintain mapping to the TextFlow. | FlowComposerBase

Property Detail

damageAbsoluteStart | property

`damageAbsoluteStart:int` [read-only]

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The absolute position immediately preceding the first element in the text flow that requires composition and updating.

Implementation
`public function get damageAbsoluteStart():int`

numLines | property |

`numLines:int` [read-only]

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The total number of lines composed in the flow. By default TLF does not compose the entire flow and this value may be innacruate. Use composeToPosition to get all lines composed.

Implementation
`public function get numLines():int`

swfContext | property |

`swfContext:ISWFContext`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The ISWFContext instance used to make FTE calls as needed.

By default, the ISWFContext implementation is this FlowComposerBase object. Applications can provide a custom implementation to use fonts embedded in a different SWF file or to cache and reuse text lines.

Implementation
`public function get swfContext():ISWFContext`
`public function set swfContext(value:ISWFContext):void`

See also

flashx.textLayout.compose.ISWFContext

textFlow | property |

`textFlow:TextFlow` [read-only]

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The TextFlow object to which this flow composer is attached.

Implementation
`public function get textFlow():TextFlow`

See also

flashx.textLayout.elements.TextFlow
Constructor Detail

FlowComposerBase | () | Constructor

`public function FlowComposerBase()`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Constructor.

Method Detail

damage | () | method

`public function damage(startPosition:int, damageLength:int, damageType:String):void`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Mark lines as damaged and needing a recompose.

Parameters

| `startPosition:int` — beginning of range to damage
| `damageLength:int` — number of characters to damage
| `damageType:String` — type of damage. One of flashx.textLayout.compose.FlowDamageType

findLineAtPosition | () | method |

`public function findLineAtPosition(absolutePosition:int, preferPrevious:Boolean = false):TextFlowLine`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Returns the TextFlowLine object containing the content at the specified position.

A position can be considered to be the division between two characters or other elements of a text flow. If the value in `absolutePosition` is a position between the last element of one line and the first element of the next, then the preceding line is returned if the `preferPrevious` parameter is set to `true` and the later line is returned if the `preferPrevious` parameter is set to `false`.

Parameters

| `absolutePosition:int` — The position of the content for which you want the TextFlowLine object.
| `preferPrevious:Boolean` (default = `false`)`` — Specifies which line to return when the position is between the last element of one line and the first element of the next.

Returns

| `TextFlowLine` — the TextFlowLine containing the content at the specified position, or null if not found.

findLineIndexAtPosition | () | method |

`public function findLineIndexAtPosition(absolutePosition:int, preferPrevious:Boolean = false):int`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Returns the sequential line number of the TextFlowLine object that contains the content at the specified position.

The number of the first line is 0 and the number of the last line is equal to the number of lines minus one. If the position specified in `absolutePosition` is past the end of the text flow, this method must return the number that will be assigned to the next new line added to the text flow (which is equal to the number of current lines).

A position can be considered to be the division between two characters or other elements of a text flow. If the value in `absolutePosition` is a position between the last line of one container and the first line of the next, then the preceding container is returned if the `preferPrevious` parameter is set to `true` and the later container is returned if the `preferPrevious` parameter is set to `false`.

Parameters

| `absolutePosition:int` — The position of the content for which you want the text line.
| `preferPrevious:Boolean` (default = `false`)`` — Specifies which container index to return when the position is between the last line in one container and the first line in the next.

Returns

| `int` — the index of the text line at the specified position. If not found, treats as past the end and returns the number of lines.

getLineAt | () | method |

`public function getLineAt(index:int):TextFlowLine`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Returns the line with the specified line number.

The list of lines is numbered from zero to the number of lines minus one. If the value in `index` is outside the bounds of the list of lines, then this function returns `null`.

Parameters

| `index:int` — The line number of the TextFlowLine object to return.

Returns

| `TextFlowLine` — the TextFlowLine with the specified line number, or `null`, if not found.

isDamaged | () | method |

`public function isDamaged(absolutePosition:int):Boolean`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Indicates whether any TextFlowLine objects between the beginning of the flow and the line containing the content at the specified position are marked as damaged.

Parameters

| `absolutePosition:int` — the last position in the area of interest

Returns

| `Boolean` — true if any of the TextFlowLine objects from the start of the flow up to the line containing the content at `absolutePosition` are marked as damaged.

isPotentiallyDamaged | () | method |

`public function isPotentiallyDamaged(absolutePosition:int):Boolean`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Indicates whether any TextFlowLine objects between the beginning of the flow and the line containing the content at the specified position are marked as damaged OR if there are other clues that the textFlow should be rebuilt.

Parameters

| `absolutePosition:int` — the last position in the area of interest

Returns

| `Boolean` — true if any of the TextFlowLine objects from the start of the flow up to the line containing the content at `absolutePosition` are marked as damaged OR if there are other reasons to believe the textFlow is damaged.

updateLengths | () | method |

`public function updateLengths(startPosition:int, deltaLength:int):void`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Update the lengths in the lines to maintain mapping to the TextFlow.

Parameters

| `startPosition:int` — beginning of change in length
| `deltaLength:int` — change in number of characters.

Wed Nov 15 2017, 09:50 AM +01:00