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

Package | org.fluint.uiImpersonation.flex
Class | public class FlexSparkVisualTestEnvironment
Inheritance | FlexSparkVisualTestEnvironment FlexMXVisualTestEnvironment VisualTestEnvironment Object

Builds a visual test environment for Flex 4.0 and above projects

Public Properties
Hide Inherited Public Properties
Show Inherited 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
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | FlexSparkVisualTestEnvironment(baseClass:Class) Constructor Creates a new test environment using the baseClass as a base. | FlexSparkVisualTestEnvironment
|  | 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 [override] Adds a visual element to the test environment. | FlexSparkVisualTestEnvironment
|  | addElementAt(element:DisplayObject, index:int):DisplayObject [override] Adds a visual element at the specified index. | FlexSparkVisualTestEnvironment
|  | 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 [override] Returns the visual element at the specified index without removing the element | FlexSparkVisualTestEnvironment
|  | getElementIndex(element:DisplayObject):int [override] Retrieves the index of the specified visual element. | FlexSparkVisualTestEnvironment
|  | removeAllChildren():void Removes all children currently in the test environment | VisualTestEnvironment
|  | removeAllElements():void [override] Removes all elements from the test environment. | FlexSparkVisualTestEnvironment
|  | 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 [override] Remove the specified visual element from the test environment. | FlexSparkVisualTestEnvironment
|  | removeElementAt(index:int):DisplayObject [override] Removes the visual element at the specified index, returning a reference to the removed element. | FlexSparkVisualTestEnvironment
|  | setChildIndex(child:DisplayObject, newIndex:int):void Updates the specified child to the new index. | VisualTestEnvironment
|  | setElementIndex(element:DisplayObject, index:int):void [override] Changes the position of the specified element to the new index. | FlexSparkVisualTestEnvironment

Constructor Detail

FlexSparkVisualTestEnvironment | () | Constructor

`public function FlexSparkVisualTestEnvironment(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

addElement | () | method

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

Adds a visual element to the test environment. Although this method takes a DisplayObject, the display object must implement the IVisualElement interface.

Parameters

| `element:DisplayObject` — visual element to add

Returns

| `DisplayObject` — A reference to the visual element

addElementAt | () | method |

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

Adds a visual element at the specified index. Any elements at or above this index will be shifted up to accomodate. Although this method takes a DisplayObject, the display object must implement the IVisualElement interface.

Parameters

| `element:DisplayObject` — visual element to add
| `index:int` — index to insert the element

Returns

| `DisplayObject` — a reference to the added element

getElementAt | () | method |

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

Returns the visual element at the specified index without removing the element

Parameters

| `index:int` — location of visual element to retrieve

Returns

| `DisplayObject` — reference to the requested element

getElementIndex | () | method |

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

Retrieves the index of the specified visual element.

Parameters

| `element:DisplayObject` — reference to the element

Returns

| `int` — location of the element

removeAllElements | () | method |

`override public function removeAllElements():void`

Removes all elements from the test environment.

removeElement | () | method |

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

Remove the specified visual element from the test environment. Although this method takes a DisplayObject, the display object must implement the IVisualElement interface.

Parameters

| `element:DisplayObject` — visual element to remove

Returns

| `DisplayObject` — a reference to the removed element

removeElementAt | () | method |

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

Removes the visual element at the specified index, returning a reference to the removed element.

Parameters

| `index:int` — location of element to remove

Returns

| `DisplayObject` — reference to removed element

setElementIndex | () | method |

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

Changes the position of the specified element to the new index. Although this method takes a DisplayObject, the display object must implement the IVisualElement interface.

Parameters

| `element:DisplayObject` — visual element to change
| `index:int` — new index of the element

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