API Documentation | All Packages | All Classes | Index | Frames No Frames |
VisualTestEnvironment

Package | org.fluint.uiImpersonation
Class | public class VisualTestEnvironment
Inheritance | VisualTestEnvironment Object
Implements | IVisualTestEnvironment
Subclasses | ActionScriptVisualTestEnvironment, FlexMXVisualTestEnvironment

Public Properties

| Property | Defined By
--- | --- | ---
|  | numChildren : int [read-only] Returns the number of children currently in the test environment | VisualTestEnvironment
|  | testEnvironment : Sprite [read-only] Returns the sprite which contains all children added to the test environment. | VisualTestEnvironment

Public Methods

| Method | Defined By
--- | --- | ---
|  | VisualTestEnvironment(baseClass:Class) Constructor Creates a new test environment using the baseClass as a base. | VisualTestEnvironment
|  | addChild(child:DisplayObject):DisplayObject Add a child to test environment. | VisualTestEnvironment
|  | addChildAt(child:DisplayObject, index:int):DisplayObject Add a display object at the specified index. | VisualTestEnvironment
|  | addElement(element:DisplayObject):DisplayObject Not used in projects prior to Flex 4. | VisualTestEnvironment
|  | addElementAt(element:DisplayObject, index:int):DisplayObject Not used in projects prior to Flex 4. | VisualTestEnvironment
|  | getChildAt(index:int):DisplayObject Retrieves the child at the specified index without removing the child. | VisualTestEnvironment
|  | getChildByName(name:String):DisplayObject Retrieves the child with the specified name without removing the child\ | VisualTestEnvironment
|  | getChildIndex(child:DisplayObject):int Retrieves the index of the specified child in the test environment | VisualTestEnvironment
|  | getElementAt(index:int):DisplayObject Not used in projects prior to Flex 4. | VisualTestEnvironment
|  | getElementIndex(element:DisplayObject):int Not used in projects prior to Flex 4. | VisualTestEnvironment
|  | removeAllChildren():void Removes all children currently in the test environment | VisualTestEnvironment
|  | removeAllElements():void Not used in projects prior to Flex 4. | VisualTestEnvironment
|  | removeChild(child:DisplayObject):DisplayObject Removes the specified child from the test environment. | VisualTestEnvironment
|  | removeChildAt(index:int):DisplayObject Removes a child at the specified index. | VisualTestEnvironment
|  | removeElement(element:DisplayObject):DisplayObject Not used in projects prior to Flex 4. | VisualTestEnvironment
|  | removeElementAt(index:int):DisplayObject Not used in projects prior to Flex 4. | VisualTestEnvironment
|  | setChildIndex(child:DisplayObject, newIndex:int):void Updates the specified child to the new index. | VisualTestEnvironment
|  | setElementIndex(element:DisplayObject, index:int):void Not used in projects prior to Flex 4. | VisualTestEnvironment

Property Detail

numChildren | property

`numChildren:int` [read-only]

Returns the number of children currently in the test environment

Implementation
`public function get numChildren():int`

testEnvironment | property |

`testEnvironment:Sprite` [read-only]

Returns the sprite which contains all children added to the test environment. This should be cast to the type of container specified at creation.

Implementation
`public function get testEnvironment():Sprite`
Constructor Detail

VisualTestEnvironment | () | Constructor

`public function VisualTestEnvironment(baseClass:Class)`

Constructor

Creates a new test environment using the `baseClass` as a base. This base needs to be a container that implements `IVisualElementContainer`.

Parameters

| `baseClass:Class` — A class reference to the container the environment should be built from.

Method Detail

addChild | () | method

`public function addChild(child:DisplayObject):DisplayObject`

Add a child to test environment.

Parameters

| `child:DisplayObject`

Returns

| `DisplayObject` — a reference to the added item.

addChildAt | () | method |

`public function addChildAt(child:DisplayObject, index:int):DisplayObject`

Add a display object at the specified index. The display object at the current index and any indexes greater will be shifted to accomodate the new object.

Parameters

| `child:DisplayObject` — display object to add
| `index:int` — index to add the child at

Returns

| `DisplayObject` — a reference to the added item

addElement | () | method |

`public function addElement(element:DisplayObject):DisplayObject`

Not used in projects prior to Flex 4. Will throw an error if called from a project before Flex 4

Parameters

| `element:DisplayObject`

Returns

| `DisplayObject`

addElementAt | () | method |

`public function addElementAt(element:DisplayObject, index:int):DisplayObject`

Not used in projects prior to Flex 4. Will throw an error if called from a project before Flex 4

Parameters

| `element:DisplayObject`
| `index:int`

Returns

| `DisplayObject`

getChildAt | () | method |

`public function getChildAt(index:int):DisplayObject`

Retrieves the child at the specified index without removing the child.

Parameters

| `index:int` — index of child to retrieve

Returns

| `DisplayObject` — a reference to the child at the specified index

getChildByName | () | method |

`public function getChildByName(name:String):DisplayObject`

Retrieves the child with the specified name without removing the child\

Parameters

| `name:String` — name of the child

Returns

| `DisplayObject` — a reference to the retrieved child

getChildIndex | () | method |

`public function getChildIndex(child:DisplayObject):int`

Retrieves the index of the specified child in the test environment

Parameters

| `child:DisplayObject`

Returns

| `int` — index of the parameter child

getElementAt | () | method |

`public function getElementAt(index:int):DisplayObject`

Not used in projects prior to Flex 4. Will throw an error if called from a project before Flex 4

Parameters

| `index:int`

Returns

| `DisplayObject`

getElementIndex | () | method |

`public function getElementIndex(element:DisplayObject):int`

Not used in projects prior to Flex 4. Will throw an error if called from a project before Flex 4

Parameters

| `element:DisplayObject`

Returns

| `int`

removeAllChildren | () | method |

`public function removeAllChildren():void`

Removes all children currently in the test environment

removeAllElements | () | method |

`public function removeAllElements():void`

Not used in projects prior to Flex 4. Will throw an error if called from a project before Flex 4

removeChild | () | method |

`public function removeChild(child:DisplayObject):DisplayObject`

Removes the specified child from the test environment. Any children with a position greater than the removed child will be shifted to accomodate the change.

Parameters

| `child:DisplayObject` — display object to remove

Returns

| `DisplayObject` — a reference to the removed child

removeChildAt | () | method |

`public function removeChildAt(index:int):DisplayObject`

Removes a child at the specified index. Any children with a position greater than the specified index will be shifted down to accomodate the change.

Parameters

| `index:int` — index of the child to remove

Returns

| `DisplayObject` — a reference to the removed child

removeElement | () | method |

`public function removeElement(element:DisplayObject):DisplayObject`

Not used in projects prior to Flex 4. Will throw an error if called from a project before Flex 4

Parameters

| `element:DisplayObject`

Returns

| `DisplayObject`

removeElementAt | () | method |

`public function removeElementAt(index:int):DisplayObject`

Not used in projects prior to Flex 4. Will throw an error if called from a project before Flex 4

Parameters

| `index:int`

Returns

| `DisplayObject`

setChildIndex | () | method |

`public function setChildIndex(child:DisplayObject, newIndex:int):void`

Updates the specified child to the new index. This has a similar effect to removing the child and re-adding it but will not broadcast and add or remove.

Parameters

| `child:DisplayObject` — child to move
| `newIndex:int` — the new index to move the child to

setElementIndex | () | method |

`public function setElementIndex(element:DisplayObject, index:int):void`

Not used in projects prior to Flex 4. Will throw an error if called from a project before Flex 4

Parameters

| `element:DisplayObject`
| `index:int`

Thu Apr 10 2014, 08:07 AM +10:00